|Title||The replicator stops if an error occurs when polling the databases|
|Assigned user||Gareth Rees|
|Description||If an error occurs when polling the databases (e.g., a network error, or a server being stopped), the replicator stops. It must be restarted by hand when the network connection re-opens. This places a large burden on the administrator.|
|Analysis||The replicator should keep running when network errors occur so that it can start replicating again as soon as the network or systems come back up again.|
These errors should be reported to the administrator if possible.
|Evidence||None as yet.|
|Created by||Gareth Rees|
|Created on||2000-10-20 15:42:20|
|Last modified by||Gareth Rees|
|Last modified on||2001-12-10 18:59:45|
|History||2000-10-20 GDR Created from personal to-do lists.|
2000-11-21 RB Improved description. Downgraded to essential.
|5388||closed||2000-12-04 18:41:38||Gareth Rees||Removing resolver role from the integration:
Tidied up the replication and mailing methods to make this part of the replicator clearer. Changed replicate_issue_to_job() to replicate_issue_dt_to_p4() and replicate_job_to_issue() to replicate_issue_p4_to_dt() for consistency with other method names. Added new methods overwrite_issue_dt_to_p4() and overwrite_issue_p4_to_dt(), which are wrappers around the above methods that also e-mail the affected parties. In order to be able to e-mail the owner of a job, added the replicator method user_email_address for getting a Perforce user's e-mail address and the replicator configuration parameter job-owner-field that names the owner field in a job (the automatic configuration generator specifies 'Owner' for this). Removed the mail_administrator method() (use mail instead), and improved the mail() method. Improved many log entries by using issue.readable_name instead of issue.id. Re-organized and documented the replicate() function. It's no less complicated than it was before, but I think it's easier to understand. Functions like replicate() and replicate_issue_p4_to_dt() no longer return a meaningful error code. They either return or throw an exception.
Changed conflict_policy so that it always returns 'dt'. This is the key change that removes the resolver's role.
Changed the handling of errors to support the change in the conflict policy. There's now no need for conflict_error, so this is gone. The reverting of jobs to the corresponding issue is handled by the revert_issue_dt_to_p4() method: this ensures that it gets called in the correct place only (that is, normal replication from Perforce to the defect tracker has failed). The replicate_many() method no longer does any handling of errors. All other errors are caught by the run() method so that the replicator can keep on going, except AssertionError and KeyboardInterrupt, both of which stop the replicator.