
Figure-1: Timed Deadlock
Example: The timed deadlock can be found in JBoss 2.4.x, please refer to the Reported Bug. The situation is caused when multiple to users (n > 20) are trying to access a portal. The connection pool size is set to 20 and the cache for portal meta data is set to expire every 2 minutes. When there are no connections in the connection pool, the requesting thread will be blocked for 30 secs (default).
The attached thread dump (from the reported bug) indicates that one thread holds a lock and ends up sleeping when trying to acquire a connection from the pool. All the other threads wait for the above lock to be release to finish their work. I am not sure if the other threads are holding connections or connections are not returned to the pool (connection leak).There could be multiple problems in JBoss portal contributing to the timed deadlock.
Conclusion: One thing is for sure that threads shouldn't hold a lock and interact with pools, especially the pools that provide waiting(sleep) option.
0 comments:
Post a Comment