dbos-inc / dbos-transact

The TypeScript framework for backends that scale
https://docs.dbos.dev
MIT License
335 stars 22 forks source link

Fix buffer flush race condition in destroy() #420

Closed qianl15 closed 3 months ago

qianl15 commented 3 months ago

This PR fixes a race condition where the buffer is being flushed when we destroy the DBOS executor. I saw sometimes the testRuntime would throw errors like Error flushing workflow inputs buffer... after tests. This is not an issue for normal execution because we never call destroy but could be confusing to see destroy errors in tests or debug mode.