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

When a server fails to start it does not cleanup its WebSocketWorker threads #668

Closed
vsch opened this issue Feb 22, 2018 · 2 comments
Closed

Comments

@vsch
Copy link

vsch commented Feb 22, 2018

When server start fails because address is already in use, it calls stop which causes a null pointer exception because selector is not yet initialized.

This exception causes the server not to interrupt its web socket workers.

Expected Behavior

cleanup web workers if server start fails

Current Behavior

Leaves the workers running

Possible Solution

In WebSocket server stop(int) method

		synchronized ( this ) {
			if( selectorthread != null  ) {
				selector.wakeup();
				selectorthread.join( timeout );
			}
		}

change to:

		synchronized ( this ) {
			if( selectorthread != null  ) {
				if (selector != null) selector.wakeup();
				selectorthread.join( timeout );
			}
		}

Steps to Reproduce (for bugs)

1.Start a server
2. Start a second server with the same address
3. Once it fails the Worker threads are still alive
4.

Debug log (for bugs)

Context

Your Environment

  • Version used: 1.3.7
  • Java version:
  • Operating System and version:
  • Endpoint Name and version:
  • Link to your project:
@marci4
Copy link
Collaborator

marci4 commented Feb 24, 2018

Hello @vsch,

thank you for your bug report.

I think this issue should already be solved on the master due to #661.

Could you please confirm this?

Greetings
marci4

@vsch
Copy link
Author

vsch commented Feb 24, 2018

@marci4, yes this is exactly the same issue.

@vsch vsch closed this as completed Feb 24, 2018
@marci4 marci4 added this to the Release 1.3.8 milestone Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants