Skip to content

Conversation

@qianl15
Copy link
Member

@qianl15 qianl15 commented Sep 3, 2025

This PR fixes a bug where DBOS.destroy() shuts down the executor pool but leaves it attached to the event loop. As a result, if DBOS is re-initialized and async functions are invoked directly, the loop still tries to use the destroyed pool and raises a runtime error.

The fix is to let the wrapper functions optionally accept a dbos instance. This makes sure the event loop is always configured correctly, even when async workflows are called directly after re-initialization.

Added a test for destroy semantics for asyncio.

@dosubot
Copy link

dosubot bot commented Sep 3, 2025

Related Documentation

Checked 4 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

Copy link
Member

@kraftp kraftp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix!

@qianl15 qianl15 merged commit 381dc4b into main Sep 3, 2025
10 checks passed
@qianl15 qianl15 deleted the qian/fix-destroy branch September 3, 2025 22:42
@dosubot
Copy link

dosubot bot commented Sep 3, 2025

Documentation updates

Checked 4 published document(s). No updates required.

How did I do? Any feedback?  Join Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants