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

Delay starting of WebSocketClient until an attempt to connect is made #1516

Closed
joakime opened this issue Apr 28, 2017 · 6 comments

Comments

Projects
None yet
1 participant
@joakime
Copy link
Member

commented Apr 28, 2017

Evaluate why enabling the Jetty Distribution's websocket module starts a bunch of Jetty HttpClient threads.

@joakime joakime self-assigned this Apr 28, 2017

@joakime joakime added the Bug label Apr 28, 2017

@joakime

This comment has been minimized.

Copy link
Member Author

commented Apr 28, 2017

The only reason those threads should be started, if if WebSocketClient itself has been started.
Which means that the end user application has accessed a WebSocketClient.

@joakime

This comment has been minimized.

Copy link
Member Author

commented May 3, 2017

There is also a desire to have the HttpClient share the Executor with the server component.

@joakime

This comment has been minimized.

Copy link
Member Author

commented May 3, 2017

The HttpClient in use by the WebSocketClient is currently following the same behaviors as the HttpClient in the proxy codebase.

@joakime

This comment has been minimized.

Copy link
Member Author

commented May 9, 2017

Creating a new base and then starting Jetty with websockets does not have the HttpClient threads.

$ mkdir mybase
$ cd mybase
$ java -jar /path/to/jetty-home/start.jar --add-to-start=http,deploy,websocket,jmx
$ java -jar /path/to/jetty-home/start.jar

No HttpClient threads present.

Next up, deploying a webapp with no websocket usage ...

@joakime

This comment has been minimized.

Copy link
Member Author

commented May 9, 2017

Adding a simple empty war to the new base results in HttpClient threads existing.

$ mkdir mybase
$ cd mybase
$ java -jar /path/to/jetty-home/start.jar --add-to-start=http,deploy,websocket
$ cp /tmp/empty.war webapps/
$ java -jar /path/to/jetty-home/start.jar
--
$ jps | grep start.jar
13172 start.jar
$ jstack -l 13172 | grep HttpClient
"HttpClient@2131952342-31" #31 prio=5 os_prio=0 tid=0x0000000029a86800 nid=0x2788 waiting on condition [0x000000002cb0e000]
"HttpClient@2131952342-30" #30 prio=5 os_prio=0 tid=0x0000000029a88000 nid=0x1b34 waiting on condition [0x000000002ca0e000]
"HttpClient@2131952342-29" #29 prio=5 os_prio=0 tid=0x0000000029a86000 nid=0x22d8 runnable [0x000000002c90e000]
"HttpClient@2131952342-28" #28 prio=5 os_prio=0 tid=0x0000000029a87800 nid=0x2fd0 waiting on condition [0x000000002c80f000]
"HttpClient@2131952342-27" #27 prio=5 os_prio=0 tid=0x0000000029b4f800 nid=0x3dc waiting on condition [0x000000002c70e000]
"HttpClient@2131952342-26" #26 prio=5 os_prio=0 tid=0x0000000029b4e800 nid=0x3b5c runnable [0x000000002c60e000]
"HttpClient@2131952342-25" #25 prio=5 os_prio=0 tid=0x0000000029b51800 nid=0x3508 runnable [0x000000002c50e000]
"HttpClient@2131952342-24" #24 prio=5 os_prio=0 tid=0x0000000029b51000 nid=0x295c runnable [0x000000002c40e000]

@joakime joakime changed the title Enabling websocket jetty-distribution module starts HttpClient threads Delay starting of WebSocketClient until an attempt to connect is made May 9, 2017

@joakime

This comment has been minimized.

Copy link
Member Author

commented May 10, 2017

Fixed in commit 753ed9e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.