Skip to content

Commit

Permalink
fixes to batching (#20)
Browse files Browse the repository at this point in the history
* split init into functions; one for new batches and one for loading batch meta

* update timeout msg

* remove batches with invalid metadata

* remove job state keyes on deletion

* update all key expirations

* lock batches before accessing them

* move removeBatch locks to outside function to avoid deadlock

* only lock when creating / deleting references

* update reference to avoid deadlock

* update child cmd to ensure batch is committed if it was opened

* do not fail jobs when a batch has expired

* use lockBatchIfExists

* remove stale batches every 24 hours

* move mutex back to batch struct

* remove unlock since it is deferred

* use defer where possible

* refactor remove stale batches to avoid deadlocks

* add tests ensuring no deadlocks

* switch from defer

* remove child when done

* close stopper properly in tests

* remove goroutine

* avoid deadlock when committing parent
  • Loading branch information
jagonalez authored Apr 13, 2022
1 parent cb6d403 commit 32b4455
Show file tree
Hide file tree
Showing 7 changed files with 277 additions and 125 deletions.
Loading

0 comments on commit 32b4455

Please sign in to comment.