[PATCH] close_connection_after_writing only if not deferred, as in cool.io

Lin Jen-Shin (godfat) godfat at godfat.org
Tue Dec 18 22:20:22 UTC 2012

On Wed, Dec 19, 2012 at 5:45 AM, Eric Wong <normalperson at yhbt.net> wrote:
> Heh, I gave that a shot way back in the day but never got it working
> to my satisfaction.  Perhaps your fix is what is needed...

Glad to know that. Hope this time we could reach your satisfaction :P
I have some hard time running the test suites though :(
I can't even pass all tests without any of my patches with:

    make EventMachine

This works better, but still cannot pass everything:

    make -j8 EventMachine

My linux crashed at the moment, and I am too lazy to fix it right now,
thus running tests on my mac. I'll try to make sure that both EventMachine
and EventMachineThreadSpawn fail on the same tests before sending
the patch. Hope this would be good enough.

I'll continue to work on EventMachineThreadPool and EventMachineFiberSpawn
only if EventMachineThreadSpawn works.

>> would need this to properly pass the tests.
>> I think this would be needed while using
>> `throw :async' as well?
> I don't think so, you just need to set @deferred=nil in a few places
> before calling quit.

I am not sure if we read it the same way, but what I mean is that
if the application is using `throw :async', we still need the check in
this patch to avoid dropping connections while receiving SIGQUIT.
Thus even if EventMachineThreadSpawn is not included, we still
need that check for regular EventMachine to quit gracefully for
applications use `throw :async'

But anyway, I still don't really understand all the details in Rainbows,
so of course it's very likely that I am simply wrong :P

> I've updated the patch and commit message.  Will apply unless
> you have objections:

Thank you for the corrections and more explanation in the commit log.
I am all for improving it, so credits don't really matter :) You could also
change all the codes and logs in the patch, like fixing my broken English
as well :P

More information about the rainbows-talk mailing list