Mantis Bugtracker
  

Viewing Issue Advanced Details [ Jump to Notes ] [ View Simple ] [ Issue History ] [ Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005861 [Resin] major always 03-03-15 19:04 03-30-15 10:39
Reporter cyflhn View Status public  
Assigned To ferg
Priority normal Resolution no change required Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.14 Product Version 3.1.13
  Product Build
Summary 0005861: thread pool dead loop
Description Thread pool dead loop often occurs especially when writing access log and the value of thread-max is not configured very high. I have checked the code. In ThreadPool.java, in method of schedule (line 481), if "poolItem"!=null and freeThreads >= freeCount, the "poolItem" will not be removed from link list headed by "_idleHead".But in line 547, method "start" of "poolItem" is invoked.So "poolItem" will become active. When "poolItem" becomes idle and returns to link list(line 702), if currently "_idleHead" points to "poolItem" itself, then _idleHead._next will point to itself. When the method "schedule" is invoked again, maybe the "poolItem" which is the current "_idleHead" is removed from link list and the poolItem._next is null(line 490). so "_idleHead" will be null forever if no other poolItems is returned to link list. Writing access log is invoked by startPriority(line 414). One thread which can not get a poolItem will block all other threads when writing access log. There is similar case in 0003509, but the problem still exists in 3.1.13.
Steps To Reproduce
Additional Information Enviroment:
Linux/Sun JDK 1.7.55/Resin 3.1.13 Open source
Max Thread count: 256
about 10M visit one day
2cpu 4G memory
Attached Files  6988_1 [^] (26,233 bytes) 03-03-15 19:04

- Relationships

- Notes
(0006597)
ferg
03-30-15 10:39

Resin 3.1 is frozen.

Note, the max thread for a 64-bit system should be expanded to something much larger, like 4096, which will avoid the problem.

The old default of 256 was small because at the time of Resin 3.1's release, 32 bit machines were more common and large numbers of threads were not well supported by the operating system.
 

- Issue History
Date Modified Username Field Change
03-03-15 19:04 cyflhn New Issue
03-03-15 19:04 cyflhn File Added: 6988_1
03-03-15 19:07 cyflhn Issue Monitored: cyflhn
03-30-15 10:39 ferg Note Added: 0006597
03-30-15 10:39 ferg Assigned To  => ferg
03-30-15 10:39 ferg Status new => closed
03-30-15 10:39 ferg Resolution open => no change required
03-30-15 10:39 ferg Fixed in Version  => 3.1.14


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker