jenkinsci / unity3d-plugin

Jenkins Unity3d plugin
https://plugins.jenkins.io/unity3d-plugin/
MIT License
96 stars 54 forks source link

Plugin can end up being unresponsive to interruption (build timeout) if a window popups #1

Open lacostej opened 12 years ago

lacostej commented 12 years ago

Unfortunately in some cases, Unity might popup a window even if running in batchmode.

In this case, the process will be hanging, and the output copier will block in the join().

Here are the threaddumps before and after the process was killed manually: https://gist.github.com/1964929

We need to find a proper way to handle this case as I doubt Unity is going to fix their dialog pop-ups anytime soon.

lacostej commented 12 years ago

Before killing the process;

"/Applications/Unity/Unity.app/Contents/MacOS/Unity -projectPath /Users/Shared/Jenkins/Home/jobs/game_DraggonEggs-trunk_win32/workspace -quit -batchmode -executeMethod MyEditorScript.PerformWin32Build: stdout copier" prio=5 tid=7fec9a73d000 nid=0x11736e000 runnable [11736d000]
   java.lang.Thread.State: RUNNABLE
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java:220)
    at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
    - locked <7becd30b8> (a java.io.BufferedInputStream)
    at java.io.FilterInputStream.read(FilterInputStream.java:90)
    at hudson.util.StreamCopyThread.run(StreamCopyThread.java:60)

"process reaper" daemon prio=5 tid=7fec9a41b800 nid=0x11726b000 runnable [11726a000]
   java.lang.Thread.State: RUNNABLE
    at java.lang.UNIXProcess.waitForProcessExit(Native Method)
    at java.lang.UNIXProcess.access$900(UNIXProcess.java:17)
    at java.lang.UNIXProcess$2$1.run(UNIXProcess.java:86)

"Pipe editor.log to output thread." prio=5 tid=7fec99ff7000 nid=0x115498000 in Object.wait() [115497000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7becc8c68> (a java.io.PipedInputStream)
    at java.io.PipedInputStream.read(PipedInputStream.java:310)
    - locked <7becc8c68> (a java.io.PipedInputStream)
    at java.io.PipedInputStream.read(PipedInputStream.java:361)
    - locked <7becc8c68> (a java.io.PipedInputStream)
    at java.io.InputStream.read(InputStream.java:82)
    at org.jenkinsci.plugins.unity3d.io.StreamCopyThread.run(StreamCopyThread.java:64)

"Executor #0 for master : executing game_DraggonEggs-trunk_win32 #197" prio=5 tid=7fec99cde000 nid=0x1151e5000 in Object.wait() [1151e4000]
   java.lang.ThreadPoolExecutor.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7beb87e40> (a org.jenkinsci.plugins.unity3d.io.StreamCopyThread)
    at java.lang.Thread.join(Thread.java:1210)
    - locked <7beb87e40> (a org.jenkinsci.plugins.unity3d.io.StreamCopyThread)
    at java.lang.Thread.join(Thread.java:1263)
    at org.jenkinsci.plugins.unity3d.Unity3dBuilder._perform(Unity3dBuilder.java:111)
    at org.jenkinsci.plugins.unity3d.Unity3dBuilder.perform(Unity3dBuilder.java:66)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
    at hudson.model.Build$RunnerImpl.build(Build.java:178)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1409)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)

After killing the process;

"Pipe editor.log to output thread." prio=5 tid=7fec99ff7000 nid=0x115498000 in Object.wait() [115497000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7becc8c68> (a java.io.PipedInputStream)
    at java.io.PipedInputStream.read(PipedInputStream.java:310)
    - locked <7becc8c68> (a java.io.PipedInputStream)
    at java.io.PipedInputStream.read(PipedInputStream.java:361)
    - locked <7becc8c68> (a java.io.PipedInputStream)
    at java.io.InputStream.read(InputStream.java:82)
    at org.jenkinsci.plugins.unity3d.io.StreamCopyThread.run(StreamCopyThread.java:64)

"Executor #0 for master : executing game_DraggonEggs-trunk_win32 #197" prio=5 tid=7fec99cde000 nid=0x1151e5000 in Object.wait() [1151e4000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <7beb87e40> (a org.jenkinsci.plugins.unity3d.io.StreamCopyThread)
    at java.lang.Thread.join(Thread.java:1210)
    - locked <7beb87e40> (a org.jenkinsci.plugins.unity3d.io.StreamCopyThread)
    at java.lang.Thread.join(Thread.java:1263)
    at org.jenkinsci.plugins.unity3d.Unity3dBuilder._perform(Unity3dBuilder.java:111)
    at org.jenkinsci.plugins.unity3d.Unity3dBuilder.perform(Unity3dBuilder.java:66)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
    at hudson.model.Build$RunnerImpl.build(Build.java:178)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1409)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)