[JIRA] [core] (JENKINS-21997) LeftItem.executable == null during QueueListener.onLeft

2014-02-28 Thread jgl...@cloudbees.com (JIRA)














































Jesse Glick
 created  JENKINS-21997


LeftItem.executable == null during QueueListener.onLeft















Issue Type:


Bug



Assignee:


Kohsuke Kawaguchi



Components:


core



Created:


28/Feb/14 5:21 PM



Description:


The QueueListener.onLeft listener callback sounds useful, except when it is called you cannot use LeftItem.getExecutable()—it is always null (even for a build which was not canceled).

https://github.com/jenkinsci/jenkins/blob/334ce1be691c96ad63642c8301c4f0417a0705c3/core/src/main/java/hudson/model/Executor.java#L207

Queue.onStartExecuting is called, which triggers the listener. Immediately afterward, WorkUnit.setExecutable is called, but that is too late for the listener.

The fix would presumably be to have onStartExecuting return its LeftItem, and make Executor.run be responsible for calling QueueListener.onLeft in this case. (The other case is Queue.cancel.)

Or perhaps it suffices to call Queue.onStartExecuting after WorkUnit.setExecutable. Unclear if that is safe; onStartExecuting also removes the BuildableItem from pendings, and is synchronized, so maybe that would introduce a race condition.




Project:


Jenkins



Priority:


Minor



Reporter:


Jesse Glick

























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups Jenkins Issues group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[JIRA] [core] (JENKINS-21997) LeftItem.executable == null during QueueListener.onLeft

2014-02-28 Thread jgl...@cloudbees.com (JIRA)














































Jesse Glick
 commented on  JENKINS-21997


LeftItem.executable == null during QueueListener.onLeft















The workaround is to use a RunListener to wait for a build to start, then call .executor.currentWorkUnit.context and match it to LeftItem.outcome.



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups Jenkins Issues group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.