When we stop an acceptor, we set the stop flag then shutdown the taskmaster. But the acceptor will only stop accepting after timeout and/or after the next connection; in the latter case, said connection will find itself without a taskmaster to process it, and will be dropped on the floor without being processed, while possibly leaking a file descriptor, meanwhile the user on the other end waits 5 minutes for a TCP timeout. That's not very nice, especially if stop is a normal part of frequent server rollouts.
To make things better, we could do one or both of these: 1- have the acceptor call the shutdown on the taskmaster after it catches its last request (or lack thereof). 2- have the acceptor use select or poll, so it can be notified of the stop in a timely fashion.
Would you accept a patch that does one or the other? What libraries are or aren't OK to pull into hunchentoot to achieve the second? [I suppose, any library that doesn't require linking a .so wrapper.]
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The hacker: someone who figured things out and made something cool happen. — Alan Schmitt
Hunchentoot must run on Windows and with LispWorks, so patches that break in either of these environments are unlikely to get pulled. Other than that, I'm open to fixes to this problem.
-Hans
On Mon, Mar 11, 2013 at 10:55 PM, Faré fahree@gmail.com wrote:
When we stop an acceptor, we set the stop flag then shutdown the taskmaster. But the acceptor will only stop accepting after timeout and/or after the next connection; in the latter case, said connection will find itself without a taskmaster to process it, and will be dropped on the floor without being processed, while possibly leaking a file descriptor, meanwhile the user on the other end waits 5 minutes for a TCP timeout. That's not very nice, especially if stop is a normal part of frequent server rollouts.
To make things better, we could do one or both of these: 1- have the acceptor call the shutdown on the taskmaster after it catches its last request (or lack thereof). 2- have the acceptor use select or poll, so it can be notified of the stop in a timely fashion.
Would you accept a patch that does one or the other? What libraries are or aren't OK to pull into hunchentoot to achieve the second? [I suppose, any library that doesn't require linking a .so wrapper.]
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The hacker: someone who figured things out and made something cool happen. — Alan Schmitt
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
Looking back at the code, it looks like the race condition can be avoided simply by moving the (shutdown (acceptor-taskmaster acceptor)) below the (when soft ...)
Do you want me to send a patch / merge request for this simple change?
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org An atheist doesn't have to be someone who thinks he has a proof that there can't be a god. He only has to be someone who believes that the evidence on the God question is at a similar level to the evidence on the werewolf question. — John McCarthy
On Mon, Mar 11, 2013 at 6:01 PM, Hans Hübner hans.huebner@gmail.com wrote:
Hunchentoot must run on Windows and with LispWorks, so patches that break in either of these environments are unlikely to get pulled. Other than that, I'm open to fixes to this problem.
-Hans
On Mon, Mar 11, 2013 at 10:55 PM, Faré fahree@gmail.com wrote:
When we stop an acceptor, we set the stop flag then shutdown the taskmaster. But the acceptor will only stop accepting after timeout and/or after the next connection; in the latter case, said connection will find itself without a taskmaster to process it, and will be dropped on the floor without being processed, while possibly leaking a file descriptor, meanwhile the user on the other end waits 5 minutes for a TCP timeout. That's not very nice, especially if stop is a normal part of frequent server rollouts.
To make things better, we could do one or both of these: 1- have the acceptor call the shutdown on the taskmaster after it catches its last request (or lack thereof). 2- have the acceptor use select or poll, so it can be notified of the stop in a timely fashion.
Would you accept a patch that does one or the other? What libraries are or aren't OK to pull into hunchentoot to achieve the second? [I suppose, any library that doesn't require linking a .so wrapper.]
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The hacker: someone who figured things out and made something cool happen. — Alan Schmitt
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
Sure, send a pull request.
-Hans
On Sun, Mar 17, 2013 at 6:49 PM, Faré fahree@gmail.com wrote:
Looking back at the code, it looks like the race condition can be avoided simply by moving the (shutdown (acceptor-taskmaster acceptor)) below the (when soft ...)
Do you want me to send a patch / merge request for this simple change?
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org An atheist doesn't have to be someone who thinks he has a proof that there can't be a god. He only has to be someone who believes that the evidence on the God question is at a similar level to the evidence on the werewolf question. — John McCarthy
On Mon, Mar 11, 2013 at 6:01 PM, Hans Hübner hans.huebner@gmail.com wrote:
Hunchentoot must run on Windows and with LispWorks, so patches that
break in
either of these environments are unlikely to get pulled. Other than
that,
I'm open to fixes to this problem.
-Hans
On Mon, Mar 11, 2013 at 10:55 PM, Faré fahree@gmail.com wrote:
When we stop an acceptor, we set the stop flag then shutdown the taskmaster. But the acceptor will only stop accepting after timeout and/or after the next connection; in the latter case, said connection will find itself without a taskmaster to process it, and will be dropped on the floor without being processed, while possibly leaking a file descriptor, meanwhile the user on the other end waits 5 minutes for a TCP timeout. That's not very nice, especially if stop is a normal part of frequent server rollouts.
To make things better, we could do one or both of these: 1- have the acceptor call the shutdown on the taskmaster after it catches its last request (or lack thereof). 2- have the acceptor use select or poll, so it can be notified of the stop in a timely fashion.
Would you accept a patch that does one or the other? What libraries are or aren't OK to pull into hunchentoot to achieve the second? [I suppose, any library that doesn't require linking a .so wrapper.]
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The hacker: someone who figured things out and made something cool
happen.
— Alan Schmitt
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel
tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel