Closed GoogleCodeExporter closed 9 years ago
Did you set the option enable_keep_alive?
Original comment by borkh...@gmail.com
on 8 Aug 2011 at 8:08
Thank's For your respone ;
As a response to your question ; no I didn't change it ;
You 'll find atached a copy of my conf file .
Original comment by mubachir...@gmail.com
on 8 Aug 2011 at 3:13
Attachments:
I have also come across this problem recently using the same mongoose version
on a linux machine.
The problem seems to occur (and is reproducable) when multiple clients (greater
than the thread count) connect simultaneously and mongoose waits while a worker
thread is available to consume the socket and service the request.
Compiled with the -DDEBUG switch, it is noticeable that the worker threads are
being terminated prematurely before the master thread (see attached debug
trace). I have done a little debugging but I am not very familiar with the
whole mongoose architecture yet and these are some observations I have made:
In the worker_thread while..loop, the stop_flag is being checked twice, once in
the beginning of the condition and another time in the function consume_socket.
In consume_socket, if the stop_flag is set, the worker thread will immediately
exit and in case this is signaled in consume_socket, the condition_variable
sq_empty is never signaled which is what is causing the hang since the
master_thread is blocking on that condition variable in the function
produce_socket.
Hope that those be of help.
Original comment by BrianG...@gmail.com
on 11 Aug 2011 at 7:53
Attachments:
Brian, thanks for the excellent analysis.
Submitted
https://code.google.com/p/mongoose/source/detail?r=9ab7368215d1cde6a180047afff17
78eee77dd8d to fix the issue.
Please verify.
Original comment by valenok
on 26 Aug 2011 at 9:20
I have just integrated the latest revision (Aug 26 2011: 55cf8bf30cd9) into my
project and did some minimal testing. So far it seems that the changes provide
the required behavior and mongoose shuts down cleanly.
Thanks for your support, quick reply, and for the project itself.
Original comment by BrianG...@gmail.com
on 29 Aug 2011 at 5:36
I am also experiencing these threads bailing in an embedded instance of
mongoose in Xcode / objective c project... here is the typical output that
occurs under even minimal loading from a single client... please advise.
*** Mongoose debug *** mg_start: root
[/Users/localadmin/Library/Developer/Xcode/DerivedData/dockBOX-bainonsuctmnfwckj
zwmpicghgeb/Build/Products/Debug]
*** Mongoose debug *** mg_set_option:
[root]->[/Users/localadmin/Library/Developer/Xcode/DerivedData/dockBOX-bainonsuc
tmnfwckjzwmpicghgeb/Build/Products/Debug/dockbox.app/Contents/Resources/htdocs]
2011-09-05 03:41:43.670 dockbox[75626:407] Document Root is at
/Users/localadmin/Library/Developer/Xcode/DerivedData/dockBOX-bainonsuctmnfwckjz
wmpicghgeb/Build/Products/Debug/dockbox.app/Contents/Resources
*** Mongoose debug *** mg_set_option: [ports]->[2011]
*** Mongoose debug *** accept_new_connection: accepted socket 10
*** Mongoose debug *** put_socket: queued socket 10
*** Mongoose debug *** worker_thread: thread 0x106533000 starting
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** get_socket: thread 0x106533000 grabbed socket 10, going
busy
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** accept_new_connection: accepted socket 11
*** Mongoose debug *** put_socket: queued socket 11
*** Mongoose debug *** get_socket: thread 0x106533000 grabbed socket 11, going
busy
[1315208507] [error] [client 127.0.0.1] GET /dragsort.js: Error 404: Not Found
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** accept_new_connection: accepted socket 11
*** Mongoose debug *** put_socket: queued socket 11
*** Mongoose debug *** get_socket: thread 0x106533000 grabbed socket 11, going
busy
[1315208507] [error] [client 127.0.0.1] GET /Icons/Thumbs/phantomjs.tiny.png:
Error 404: Not Found
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** accept_new_connection: accepted socket 11
*** Mongoose debug *** put_socket: queued socket 11
*** Mongoose debug *** get_socket: thread 0x106533000 grabbed socket 11, going
busy
[1315208507] [error] [client 127.0.0.1] GET /Icons/Thumbs/Cocoa Web
App.tiny.png: Error 404: Not Found
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** accept_new_connection: accepted socket 11
*** Mongoose debug *** put_socket: queued socket 11
*** Mongoose debug *** get_socket: thread 0x106533000 grabbed socket 11, going
busy
[1315208507] [error] [client 127.0.0.1] GET /Icons/phantomjs.png: Error 404:
Not Found
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** accept_new_connection: accepted socket 11
*** Mongoose debug *** put_socket: queued socket 11
*** Mongoose debug *** get_socket: thread 0x106533000 grabbed socket 11, going
busy
[1315208507] [error] [client 127.0.0.1] GET /Icons/Cocoa Web App.png: Error
404: Not Found
*** Mongoose debug *** get_socket: thread 0x106533000: going idle
*** Mongoose debug *** worker_thread: thread 0x106533000 exiting
Original comment by a...@mrgray.com
on 5 Sep 2011 at 7:45
Original issue reported on code.google.com by
mubachir...@gmail.com
on 6 Aug 2011 at 11:32