|
Mantis - Resin
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 5861 | major | always | 03-03-15 19:04 | 03-30-15 10:39 | |
|
|
|||||
| Reporter: | cyflhn | Platform: | |||
| Assigned To: | ferg | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.1.13 | ||
| Product Build: | Resolution: | no change required | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 3.1.14 | ||
|
|
|||||
| 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 |
||||
| Relationships | |||||
| Attached Files: |
|
||||
| Notes | |||||
|
|
|||||
|
|
||||