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

Deadlock on client connect when using multiple client threads and SSLcontext #985

Open
bluelu opened this issue Mar 9, 2020 · 2 comments

Comments

@bluelu
Copy link

bluelu commented Mar 9, 2020

Hi,

One of the clients will hang forever on creating the connection to the server when multiple threads are used and the SSL Context is used:

park:-1, Unsafe (jdk.internal.misc)
park:194, LockSupport (java.util.concurrent.locks)
parkAndCheckInterrupt:885, AbstractQueuedSynchronizer (java.util.concurrent.locks)
doAcquireSharedInterruptibly:1039, AbstractQueuedSynchronizer (java.util.concurrent.locks)
acquireSharedInterruptibly:1345, AbstractQueuedSynchronizer (java.util.concurrent.locks)
await:232, CountDownLatch (java.util.concurrent)
connectBlocking:367, WebSocketClient (org.java_websocket.client)

There is no issue if:

  • No ssl Context is used
  • If you synchronize the connectBlocking(); call

Please see below (it sets up the sslcontext as described in your example) which will reproduce the problem. (It will output forever waiting for future)

Link to example to recreate issue:
https://pastebin.com/hF5kpqyE

@bluelu
Copy link
Author

bluelu commented Mar 12, 2020

Unfortunately I also managed to get the hanging threads with multiple threads and the synchronize on connectBlocking. It just seems to happen less often, thus probably a race condition somewhere.

@BTCPowerDev
Copy link

Hello Everyone,

Is there any planning to resolve this issue in any upcoming releases?

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

3 participants