From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9BE941F4B4; Mon, 28 Sep 2020 05:52:44 +0000 (UTC) Date: Mon, 28 Sep 2020 05:52:43 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH] gcf2: improve error handling and do not ->fail on wbuf Message-ID: <20200928055243.GA79500@dcvr> References: <20200927221248.28815-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200927221248.28815-1-e@80x24.org> List-Id: Putting words together to write commit messages is hard without enough sleep :< Anyways, revised and pushed as commit 8ba04f214bbadcbe106c94281a0c4c21dd50adb8 gcf2: improve error handling and do not ->fail on wbuf For historical reasons, both Danga::Socket::write and PublicInbox::DS::write will return 0 when data is buffered; so Gcf2Client must not call ->fail when DS::write returns 0. We'll also improve robustness by recreating the entire Gcf2Client object if it does die for other reasons, instead of risking mismatched fields due to deferred close. We also need to ensure we only get one EPOLLERR wakeup and issue EPOLL_CTL_DEL if ->event_step is triggered by a dying Gcf2 process, so always register the FD with EPOLLONESHOT.