user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/2] httpd/async: do not attempt future writes on closed sockets
  2016-07-09  4:51  4% [PATCH 0/2] httpd/async race fixes Eric Wong
@ 2016-07-09  4:51  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-07-09  4:51 UTC (permalink / raw)
  To: meta

Danga::Socket::close does not clear the write_buf_size field,
so it's conceivable we could attempt to queue up data and
callbacks we can never flush out.
---
 lib/PublicInbox/HTTPD/Async.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/PublicInbox/HTTPD/Async.pm b/lib/PublicInbox/HTTPD/Async.pm
index a936d9b..880cf02 100644
--- a/lib/PublicInbox/HTTPD/Async.pm
+++ b/lib/PublicInbox/HTTPD/Async.pm
@@ -41,6 +41,7 @@ sub async_pass {
 		my $r = sysread($self->{sock}, $$bref, 8192);
 		if ($r) {
 			$fh->write($$bref);
+			return if $io->{closed};
 			if ($io->{write_buf_size}) {
 				$self->watch_read(0);
 				$io->write($restart_read); # D::S::write
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/2] httpd/async race fixes
@ 2016-07-09  4:51  4% Eric Wong
  2016-07-09  4:51  7% ` [PATCH 1/2] httpd/async: do not attempt future writes on closed sockets Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-07-09  4:51 UTC (permalink / raw)
  To: meta

Oops, these are some tricky fixes which took a while to notice
and find during stress testing.

Eric Wong (2):
      httpd/async: do not attempt future writes on closed sockets
      httpd/async: reinstate D::S timer usage for cleanup

 lib/PublicInbox/EvCleanup.pm   | 9 +++++++++
 lib/PublicInbox/HTTPD/Async.pm | 3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)


^ permalink raw reply	[relevance 4%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-07-09  4:51  4% [PATCH 0/2] httpd/async race fixes Eric Wong
2016-07-09  4:51  7% ` [PATCH 1/2] httpd/async: do not attempt future writes on closed sockets Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).