appy-one / acebase-server

A fast, low memory, transactional, index & query enabled NoSQL database server for node.js that easily syncs with browser and node.js clients and servers
MIT License
32 stars 14 forks source link

Handle transactions that timeout without starting #94

Closed fahhem closed 8 months ago

appy-one commented 10 months ago

Hi @fahhem I'm happy to merge if you can please describe when this happens? Also, please use the shorter syntax tx.finish?.()

And apologies for this late reply!

fahhem commented 8 months ago

The previous code assumed tx.finish was set, even though it's set in a doubly-nested callback that requires:

All the while, the timeout for finishing/canceling has already started. I'm not 100% certain, but that seems to be 3 or more round-trips through the scheduler and possibly many javascript executions to run the rules. That means if you have enough rules and the server is busy enough, the transaction will never start

appy-one commented 8 months ago

@fahhem Merged! Thanks a lot for contributing and for clarifying, I'll take a look if I can improve this