Riverside-Software / pct

Build automation for OpenEdge ABL
Apache License 2.0
96 stars 62 forks source link

Exception in BackgroundWorker when using multiple threads #363

Closed droppedcalls closed 5 years ago

droppedcalls commented 5 years ago

Subject of the issue

When running multiple threads on some systems, in particular our Red Hat Jenkins build agents, the following exception would occur:

[PCTCompile] Exception in thread "Thread-1351" java.lang.NullPointerException
[PCTCompile]     at com.phenix.pct.BackgroundWorker.listen(BackgroundWorker.java:105)
[PCTCompile]     at com.phenix.pct.PCTBgRun$ListenerThread$1.run(PCTBgRun.java:686)
[PCTCompile]     at java.lang.Thread.run(Thread.java:748)

Your environment

Actual behaviour

The build succeeds, but several threads may show the above error, which appears to be benign

Expected behaviour

No errors should be printed Looking at line 105 in BackgroundWorker.listen(), it is assumed that the read does not return null.

Steps to reproduce

We only had this issue happen on the Jenkins build agent with a large number of threads

droppedcalls commented 5 years ago

I have written a fix already; I just need to rebase before creating a pull request