replikativ / datahike

A fast, immutable, distributed & compositional Datalog engine for everyone.
https://datahike.io
Eclipse Public License 1.0
1.62k stars 95 forks source link

Fix core.async deadlock in send-transaction! #536

Closed sundbry closed 2 years ago

sundbry commented 2 years ago

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

SUMMARY

Checks

Bugfix

ADDITIONAL INFORMATION

whilo commented 2 years ago

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.

sundbry commented 2 years ago

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.