Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling stuck threads #39

Closed
erelsgl opened this issue Jan 13, 2013 · 3 comments
Closed

Handling stuck threads #39

erelsgl opened this issue Jan 13, 2013 · 3 comments

Comments

@erelsgl
Copy link

erelsgl commented Jan 13, 2013

When a worker thread gets stuck (for example, in an endless loop or a deadlock), it seems that the server keeps spawning new threads to do the same task, which may make the situation worse.

To check this, I created a small server that, when accepting the "HANG" event, just does a for(;;) loop. This is what I see in the log:

INFO 09:53:46 [New I/O worker #6 ]: start
INFO 09:53:46 [New I/O worker #6 ]: looping forever
INFO 09:54:38 [New I/O worker #8 ]: start
INFO 09:54:38 [New I/O worker #8 ]: looping forever
INFO 09:54:58 [New I/O worker #10 ]: start
INFO 09:54:58 [New I/O worker #10 ]: looping forever
INFO 09:55:18 [New I/O worker #12 ]: start
INFO 09:55:18 [New I/O worker #12 ]: looping forever
INFO 09:55:38 [New I/O worker #14 ]: start
INFO 09:55:38 [New I/O worker #14 ]: looping forever
INFO 09:55:58 [New I/O worker #16 ]: start
INFO 09:55:58 [New I/O worker #16 ]: looping forever
...

@mrniko
Copy link
Owner

mrniko commented Jan 14, 2013

Could you propose own solution? What version of netty do you use?

@erelsgl
Copy link
Author

erelsgl commented Jan 14, 2013

I don't quite understand what is the cause of this - does netty automatically generates a new event, in case the previous event did not return?

Where exactly is this done in the socket.io code? I can try to look at it.

I have netty 3.6.0

@mrniko
Copy link
Owner

mrniko commented Jan 14, 2013

I did not faced with such case, think it's somethere in netty. You can take a look at SocketIOPipelineFactory.getPipeline - it is the message handlers chain builder.

@mrniko mrniko closed this as completed Feb 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants