Closed
Description
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: