Thread deadlock #356
Replies: 1 comment
-
Can't you just use a different thread here? This should make it work |
Beta Was this translation helpful? Give feedback.
-
Can't you just use a different thread here? This should make it work |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Im opening this on Discussions because I dont know if its an issue that can be fixed given the blocking nature of the Socket itself, but maybe it should be documented?
I recently upgraded from 3.2.3 (which started banning the number when reading the qrcode) to 3.5.1 and on my computer with a single number everything worked fine, but as soon as I uploaded to a VPS that I have with 6 numbers it didnt work. I connect to the numbers in sequence with a delay between them, the first number connected fine, but as soon as the second connected they all get stuck, no stacktraces or anything, I would just get a socket OPEN event and some time later a CLOSE event with no other information.
I noticed all threads being stuck in the same place, so I increase the available cores from 4 to 8 (using -XX:ActiveProcessorCount=8) and it improved, but after some time they all got stuck again.
Now I setup a cached thread pool, overriding the shutdownNow() because it is called when the socket closes, I saw peaks of 10 active threads for 6 numbers mostly in idle. It appears it requires quite a few available threads to work, specialy since the CompletableFuture still uses the common pool even when provided with an executor.
`
private static final ThreadPoolExecutor WHATSAPP_EXECUTOR;
Thread dump
threads-1690653410405.txt
Beta Was this translation helpful? Give feedback.
All reactions