From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FE49C35242 for ; Sat, 8 Feb 2020 18:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E431920661 for ; Sat, 8 Feb 2020 18:48:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=anarazel.de header.i=@anarazel.de header.b="kQAVMhcX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OGjJ4DbO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727473AbgBHSsL (ORCPT ); Sat, 8 Feb 2020 13:48:11 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:34737 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727471AbgBHSsL (ORCPT ); Sat, 8 Feb 2020 13:48:11 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AF09422027; Sat, 8 Feb 2020 13:48:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 08 Feb 2020 13:48:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=ZfFSW57hq8utcXEveHJZrGZfdRR 3t2kGNib7bvNxAsc=; b=kQAVMhcX4Q03bSgPm1kk3WOh8w0isIHzNvwLufjrA48 mS53I4ydJuPrTwkDhvW4oEf6zZUtUe/1UdzQiXwOX1xRTWEK9CSTqM5pyAQyleyx dEwmweI0qIwzCl6UJ4luQ9F9YSVXLrWulUnVv+msvJnb1u40WQcSpn/1TzHz7q0t MSr42RWgeje6bGLCy/rSVK709fq2vop/HWMsOn4MOERGZvy89rBzFEWV7/TJzkIJ VylSztkwNf3JDLU6MaCUuIi20COOFZMbJQ7j3IzQXMruaAPJwH/3iz+2E6Nj1wel wo5uXEp2X/UP4gpeYiEQicBtKpOWc4n9wZNL08iZyKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ZfFSW5 7hq8utcXEveHJZrGZfdRR3t2kGNib7bvNxAsc=; b=OGjJ4DbO89nPWae+Gop/sh hQYrnhYwvZ7/EUbQVk1DJFReoD3YNSGtxyRpcpavoLCVWLM8nARQ9J+yTlYqCIBG Zr8gBmXtfQNDwiDfMd0wxOWE4W41qx6Pk99Z34CTxtZwOmIymTaHiBGpVD+pzgvt xvY1d3fFrdqrPQ4yhv7KkfvZ1V+X6IoeqbYlbFQlrkyU0QKho9bDsIFtQqtANsya XNPjTdUHC27G+STn23yxHptvtalfbzeqru1O6Q0WbACfd3Fx1SeOOPGzAJk81Xhp 9A62s+PpLlrKJlR5nFVIdvd69GPfj2fdZ2UCpsKxBgOktpZRpohkySEphZIWlSYQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrheejgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepie ejrdduiedtrddvudejrddvhedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id CE7DA30606E9; Sat, 8 Feb 2020 13:48:09 -0500 (EST) Date: Sat, 8 Feb 2020 10:48:08 -0800 From: Andres Freund To: Glauber Costa Cc: io-uring@vger.kernel.org, Jens Axboe , Avi Kivity Subject: Re: shutdown not affecting connection? Message-ID: <20200208184808.jxrnsl3xyoj7io6c@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Hi, On 2020-02-08 08:55:25 -0500, Glauber Costa wrote: > - A connect() call is issued (and in the backend I can choose if I use > uring or not) > - The connection is supposed to take a while to establish. > - I call shutdown on the file descriptor > > If io_uring is not used: > - connect() starts by returning EINPROGRESS as expected, and after > the shutdown the file descriptor is finally made ready for epoll. I > call getsockopt(SOL_SOCKET, SO_ERROR), and see the error (104) > > if io_uring is used: > - if the SQE has the IOSQE_ASYNC flag on, connect() never returns. That should be easy enough to reproduce without seastar as it sounds deterministic - how about modifying liburing's test/connect.c test to behave this way? Hm, any chance you set O_NONBLOCK on the fd, before calling the async connect? Wonder if io_connect() file_flags = force_nonblock ? O_NONBLOCK : 0; ret = __sys_connect_file(req->file, &io->connect.address, req->connect.addr_len, file_flags); if ((ret == -EAGAIN || ret == -EINPROGRESS) && force_nonblock) { fully takes into account that __sys_connect_file err = sock->ops->connect(sock, (struct sockaddr *)address, addrlen, sock->file->f_flags | file_flags); appears to leave O_NONBLOCK set on the file in place, which'd then not block in the wq? Greetings, Andres Freund