Part of lp.codehosting.codeimport.workermonitor View In Hierarchy
Known subclasses: lp.codehosting.codeimport.tests.test_workermonitor.CIWorkerMonitorForTesting, lp.codehosting.codeimport.tests.test_workermonitor.TestWorkerMonitorRunNoProcess.WorkerMonitor, lp.codehosting.codeimport.tests.test_workermonitor.TestWorkerMonitorUnit.WorkerMonitor
An instance of CodeImportWorkerMonitor
runs a child process to
perform an import and communicates status to the database.
Method | __init__ | Construct an instance. |
Method | getWorkerArguments | Get arguments for the worker for the import we are working on. |
Method | updateHeartbeat | Call the updateHeartbeat method for the job we are working on. |
Method | finishJob | Call the finishJobID method for the job we are working on. |
Method | run | Perform the import. |
Method | callFinishJob | Call finishJob() with the appropriate status. |
Method | _logOopsFromFailure | Undocumented |
Method | _trap_nosuchcodeimportjob | Undocumented |
Method | _createLibrarianFileAlias | Call IFileUploadClient.remoteAddFile with the given parameters. |
Method | _makeProcessProtocol | Make an CodeImportWorkerMonitorProtocol for a subprocess. |
Method | _launchProcess | Launch the code-import-worker.py child process. |
Method | _silenceQuietExit | Quietly swallow a ExitQuietly failure. |
Method | _reasonToStatus | Translate the 'reason' for process exit into a result status. |
Parameters | job_id | The ID of the CodeImportJob we are to work on. |
logger | A Logger object. |
This also sets the _target_url and _log_file_name attributes for use in the _logOopsFromFailure and finishJob methods respectively.
IFileUploadClient.remoteAddFile
with the given parameters.
This is a separate method that exists only to be patched in tests.
This method uploads the log file to the librarian first.