This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: |
RequestProcessor may never execute Tasks |
Product: |
platform
|
Reporter: |
mklaehn <mklaehn> |
Component: |
-- Other -- | Assignee: |
Jaroslav Tulach <jtulach> |
Status: |
RESOLVED
FIXED
|
|
|
Severity: |
normal
|
|
|
Priority: |
P1
|
|
|
Version: |
7.4 | |
|
Hardware: |
All | |
|
OS: |
All | |
|
Issue Type:
|
DEFECT
|
Exception Reporter:
|
|
Bug Depends on: |
|
|
|
Bug Blocks: |
226051
|
|
|
Attachments: |
proposed patch
|
Created attachment 142435 [details] proposed patch In our application we have had the problem that tasks (Runnable and Callable alike) that have been dispatched on a specific RequestProcessor are never executed. The RequestProcessor in question is created using the following invokation: new RequestProcessor(EventDataManagerRequestHandler.class.getSimpleName(), 2, false, false) In our logfiles we've seen two of the following exceptions java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:713) at org.openide.util.RequestProcessor$Processor.get(RequestProcessor.java:1921) at org.openide.util.RequestProcessor.enqueue(RequestProcessor.java:617) at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:1524) at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:1495) at org.openide.util.RequestProcessor.submit(RequestProcessor.java:816) Our application (at those times) is running with a fairly extensive heap and number of threads. We are at the limit of the system we're required to run on. It is not surprising to get that Exception. What is surprising is that the RequestProcessor did not attempt to run its submitted tasks. A heapdump supported this finding. Further analysis of heap showed that the RequestProcessor in question showed throughput = 2 running = 2 processors.size() = 0 Code analysis showed that running is increased prior to retrieving a new Processor via Processor.get(). Should an Exception occur during the retrieval of a new Processor the RequestProcessor will think it actually got the Processor. Let that happen two time in this case and that RequestProcessor will never execute anything it is to execute. The attached Patch will rectify this problem.