Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368189 - WebSocketClientFactory should not manage external thread pool
Summary: WebSocketClientFactory should not manage external thread pool
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: websocket (show other bugs)
Version: 7.6.0.RC3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Simone Bordet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-09 14:15 EST by Simone Bordet CLA
Modified: 2012-01-09 14:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simone Bordet CLA 2012-01-09 14:15:00 EST
Some of the WebSocketClientFactory take a ThreadPool parameter.

The usual contract for dependencies is that if they are injected, then their lifecycle is managed externally.

Unfortunately, WebSocketClientFactory wants to manage the ThreadPool passed in as constructor parameter, resulting in problems at shutdown, especially if the ThreadPool is shared.

The typical example is when the ThreadPool is shared between two components; stopping the first one will stop also the ThreadPool, which hampers the functionality of the second: the second component may need to do some threaded work (such as closing connections) but it cannot because the ThreadPool is already stopped.

WebSocketClientFactory should stick with the usual contract of managing the lifecycle only of internally created ThreadPools.
Comment 1 Simone Bordet CLA 2012-01-09 14:37:06 EST
Fixed.
Now WebSocketClientFactory correctly manages the ThreadPool parameter: if external, its lifecycle is not invoked.