]> Sergey Matveev's repositories - public-inbox.git/commit - lib/PublicInbox/GitAsyncCat.pm
gcf2: improve error handling and do not ->fail on wbuf
authorEric Wong <e@80x24.org>
Sun, 27 Sep 2020 22:12:48 +0000 (22:12 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Sep 2020 05:48:14 +0000 (05:48 +0000)
commit8ba04f214bbadcbe106c94281a0c4c21dd50adb8
treea225cd4a836ead39d6b1f2dc4a72f81409684db6
parent28dec3a76687617a3a697058964dc0bd1351eb6b
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.
lib/PublicInbox/Daemon.pm
lib/PublicInbox/Gcf2Client.pm
lib/PublicInbox/GitAsyncCat.pm