Ticket 797 - Fix locking problem when handling exception during ticket sync #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fix for the lock with fairly simple, wrapping an in try/finally to release the lock. (It's using a double-loc idiom, and I couldn't figure out the "python" way to phrase it.)
The challenge was deconstructing the logic in
get_sync_record()
, which I refactored intoget_
andvalidate_sync_record
, allowing a cleaner solution to conflict/error detection and resolution.(WTF was I thinking in the original get_sync_record?)
It works under test and deployed to my integration test bed. The new links to existing threads is handy.