datahike icon indicating copy to clipboard operation
datahike copied to clipboard

Fix core.async deadlock in send-transaction!

Open sundbry opened this issue 3 years ago • 0 comments
trafficstars

send-transaction! was blocking (go) threads on the parking (>!!) operation.

SUMMARY

Checks

Bugfix
  • [ ] Related issues linked using fixes #number
  • [ ] Integration tests added
  • [ ] Architecture Decision Record added if design changes necessary
  • [ ] Formatting checked
  • [ ] CHANGELOG.md updated

ADDITIONAL INFORMATION

sundbry avatar May 12 '22 22:05 sundbry

This is definitely better than potential deadlocks, but it does not exert backpressure. I have converted all transactor calls to non-blocking core.async calls here, /blob/c12d5902d85f0159488103f55e5e04b3e1620293/src/datahike/transactor.cljc, which is better. Feel free to borrow as much from the this PR as needed and I will rebase it.

whilo avatar Aug 24 '22 23:08 whilo

Hi @whilo, I agree we should figure out some way to exert backpressure here. I will have to come back to this. It looks like that commit is part of this branch https://github.com/replikativ/datahike/pull/337/files, there is a lot going on there, it is hard to see what the specific changes were in re: send-transaction backpressure.

sundbry avatar Aug 25 '22 20:08 sundbry