raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

Channel.getMode() prone to deadlock thread #240

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
getMode() is waiting eternally for the modeLatch to countdown.
This can lead (at least in 1.x) to deadlock during shutdown.
Cf. https://issues.jenkins-ci.org/browse/JENKINS-28175

I cannot see (because of Lombok Getter magic) if the same problem persists in 
2.x
Anyway, it seems like a bad idea to wait forever on the latch as setMode might 
not be called because of various reasons

Original issue reported on code.google.com by cku...@gmail.com on 1 May 2015 at 1:48

GoogleCodeExporter commented 9 years ago
This was fixed in 2.0 by caching the user key and other information. Its quite 
hard to backport this to 1.x though. 

Original comment by Lord.Qua...@gmail.com on 1 May 2015 at 3:43

GoogleCodeExporter commented 9 years ago
Thanks.
And you don't think that waiting forever on the countDownLatch could be a 
problem in other cases?

Original comment by cku...@gmail.com on 1 May 2015 at 4:03

GoogleCodeExporter commented 9 years ago
The latest snapshot is a lot more careful with how it handles that Countdown. 
It is needed though as there are a lot of edge cases where you don't have valid 
mode information. 

Original comment by Lord.Qua...@gmail.com on 1 May 2015 at 5:10