Skip to content

Run MainDriver outside node event loop#715

Draft
nasif-z wants to merge 1 commit into
devfrom
nodecli-outside-event-loop
Draft

Run MainDriver outside node event loop#715
nasif-z wants to merge 1 commit into
devfrom
nodecli-outside-event-loop

Conversation

@nasif-z

@nasif-z nasif-z commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Run MainDriverApi.main() in the default executor from RunProcess.
  • Wrap the async MainDriver entrypoint with asyncio.run() inside the worker thread so the coroutine is executed.
  • Keep the node CLI event loop available for service callbacks, install polling, and local server tasks while MainDriver performs blocking work.

@riz-hossain

Copy link
Copy Markdown
Contributor

🔎 ZeuZ PR Review

Open the full report in ZeuZ: Review findings and apply suggestions

Overview Value
Agents ✅ 4 completed
Suggestions 💡 2

Agent breakdown

→ General Review

Status: ✅ Completed
Suggestions: 0 suggestions

No actionable issues found in the diff; the change cleanly moves MainDriverApi.main off the node CLI event loop without introducing an obvious correctness regression.

→ Security Review

Status: ✅ Completed
Suggestions: 0 suggestions

No security findings in this PR diff. The change only moves MainDriverApi.main execution off the event loop and does not introduce new input handling, auth, or data exposure risks.

→ Performance Review

Status: ✅ Completed
Suggestions: 1 suggestion

The change correctly moves MainDriverApi.main off the node event loop, but it introduces a per-run thread hop plus a fresh asyncio event loop, which adds avoidable overhead in a hot execution path.

→ Testing Review

Status: ✅ Completed
Suggestions: 1 suggestion

The PR changes the MainDriverApi.main invocation path, but there is no regression test covering the new executor-based flow or proving the call no longer runs on the event-loop thread.

Open ZeuZ to inspect full findings, continue an agent conversation, or apply safe patch suggestions.

@nasif-z nasif-z self-assigned this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants