bzr xmllog process continues even when build is stopped.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bzr-hudson |
Confirmed
|
High
|
Unassigned |
Bug Description
To reproduce:
Start a build for a large project.
Make sure that the change log is very large and that bzr-hudson is configured to fetch the entire history.
While the entire history is being fetched (bzr xmllog), cancel the build using hudson's "red x" next to the build progress bar.
Open the OS's process monitor and note the bzr is running at almost 100%. (of a single cpu). This will continue like this until it finishes or the user manually kill's this process.
Expected behaviour:
The bzr xmllog should stop when the build is stopped.
Recommended solution:
Listen to the cancel event from hudson and stop the logTask.
Besides the above, an extra solution should be in place for other component's using bzr-java-lib or bzr-xmloutput (not sure which of the two are responsible.)
The bzr xmllog process should ping or poll its parent every N seconds to determine whether or not is should continue with its operation. This would be useful since the process spawning (parent) bzr xmllog might die unexpectedly and cause it to run unnecessarily.
Craig, logAsync instead of IBazaarClient. loginterrupt
Thanks for poiting this out.
This is an issue in bzr-java-lib, that it's reflected as this weird behaviour in bzr-hudson.
The main issue is that the xmllog command is executed in the xmlprc service, so the request keeps executing in the server.
I think the xmlrpc service in bzr-xmloutput should handle this, but the current implementation just delegated to the bzr command so it block and can't do much about it.
So, as temporary workaround I propose to handle this in bzr-java-lib, from the top of my head, two options to fix this:
1) get the changelog in chunks using IBazaarClient.log
2) change bzr-hudson to use a "custom" version of IBazaarClient.
I think 2) is the easiest way to get things going, this imply some code duplication if it's implemented in bzr-hudson but we could add a variant of IBazaarClient. logAsync in bzr-java-lib that returns the List of Future's instead of waiting for the execution ofo each runnable to avoid code duplication.
Let me know what you think.
Regards,