Part of lp.codehosting.puller.scheduler View In Hierarchy
Method | __init__ | Construct an instance of the protocol, for listening to a worker. |
Method | reportMirrorFinished | Undocumented |
Method | checkReportingFinishedAndNoStderr | Check that the worker process behaved properly on clean exit. |
Method | ensureReportingFinished | Clean up after the worker process exits uncleanly. |
Method | makeConnection | Called when the process has been created. |
Method | outReceived | Undocumented |
Method | errReceived | Undocumented |
Method | do_startMirroring | Undocumented |
Method | do_branchChanged | Undocumented |
Method | do_mirrorFailed | Undocumented |
Method | do_progressMade | Any progress resets the timout counter. |
Method | do_log | Undocumented |
Inherited from ProcessMonitorProtocolWithTimeout:
Method | callLater | Override TimeoutMixin.callLater so we use self._clock. |
Method | connectionMade | Start the timeout counter when connection is made. |
Method | timeoutConnection | When a timeout occurs, kill the process and record a TimeoutError. |
Method | processEnded | See ProcessMonitorProtocol.processEnded . |
Inherited from ProcessMonitorProtocol (via ProcessMonitorProtocolWithTimeout):
Method | runNotification | Run a given function in series with other notifications. |
Method | unexpectedError | Something's gone wrong: kill the subprocess and report failure. |
Inherited from ProcessProtocolWithTwoStageKill (via ProcessMonitorProtocolWithTimeout, ProcessMonitorProtocol):
Method | terminateProcess | Terminate the process by SIGINT initially, but SIGKILL if needed. |
Method | _sigkill | Forcefully kill the process. |
Parameters | deferred | A Deferred that will be fired when the worker has finished (either successfully or unsuccesfully). |
listener | A PullerMaster object that is notified when the protocol receives events from the worker. | |
clock | A provider of Twisted's IReactorTime. This parameter exists to allow testing that does not depend on an external clock. If a clock is not passed in explicitly the reactor is used. |
When the process exits cleanly, we expect it to have not printed anything to stderr and to have reported success or failure. If it has failed to do either of these things, we should fail noisily.
If the worker process exited uncleanly, it probably didn't report success or failure, so we should report failure. If there was output on stderr, it's probably a traceback, so we use the last line of that as a failure reason.