fix: preserve Go scope stacks across OS threads#100
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (9)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (28)crates/ffi/**📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
Files:
**/*.rs📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
Files:
{crates/ffi/nemo_flow.h,crates/ffi/src/**/*.rs}📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
Files:
**/*.{rs,go,js,ts,tsx}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.{rs,py,go,js,ts,tsx}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.{js,ts,tsx,jsx,py,rs,go,java,c,cpp,h,cc,cxx,cs,rb,php,swift,kt}📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Files:
**/*.{py,js,ts,tsx,go,rs,md}📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
**/*.{rs,py,js,ts,tsx,go}📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
crates/{python,ffi,node,wasm}/**/*⚙️ CodeRabbit configuration file
Files:
**/*.h📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
crates/ffi/nemo_flow.h📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
crates/core/src/api/**/*.rs📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Files:
crates/{core,adaptive}/**📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Files:
{crates/core,crates/adaptive}/**/*.rs📄 CodeRabbit inference engine (.agents/skills/test-wasm-binding/SKILL.md)
Files:
crates/core/**/*.rs📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
crates/{core,adaptive}/**/*.rs⚙️ CodeRabbit configuration file
Files:
go/nemo_flow/**/*.go📄 CodeRabbit inference engine (.agents/skills/test-go-binding/SKILL.md)
Files:
**/*.go📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.{md,markdown,py,sh,bash,js,ts,java,cpp,go,rust}📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Files:
{crates/adaptive/**,python/nemo_flow/{adaptive,plugin}.py,go/nemo_flow/{adaptive,**}/*.go,**/*.{ts,js,wasm}}📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Files:
{crates/adaptive/**/*.rs,python/nemo_flow/adaptive.py,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{helper,constructor,builder}.{ts,tsx,js}}📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Files:
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{plugin,lifecycle}.{ts,tsx,js}}📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Files:
{crates/adaptive/**/*.rs,python/nemo_flow/plugin.py,go/nemo_flow/**/*.go,**/{context,plugin}.{ts,tsx,js,rs}}📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Files:
{docs/**,examples/**,crates/adaptive/**,python/nemo_flow/**,go/nemo_flow/**,**/{example,component}.{ts,tsx,js,rs,py,go}}📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Files:
go/**/*.go📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
Files:
go/nemo_flow/**/*⚙️ CodeRabbit configuration file
Files:
{crates/**/tests/**,python/tests/**,go/nemo_flow/**/*_test.go}⚙️ CodeRabbit configuration file
Files:
crates/ffi/src/api/**/*.rs📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)
Files:
🔇 Additional comments (11)
WalkthroughThis PR adds thread-local scope stack binding capture and restore functionality across Rust core, FFI boundary, and Go bindings. A new ChangesThread-local Scope Stack Binding
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
|
/merge |
Overview
Fix intermittent Windows Go test failures caused by Go goroutines moving between OS threads while NeMo Flow scope state is stored in Rust thread-local fallback storage.
Details
ScopeStack.Runto restore the previous Rust thread-local binding before releasing the locked OS thread.ScopeStack.RunsoPushScope,EmitEvent, andPopScopestay on one OS thread.ScopeStackActive()is restored afterRun.Where should the reviewer start?
Start with
go/nemo_flow/nemo_flow.gofor the Go runtime behavior, then reviewcrates/core/src/api/runtime/scope_stack.rsandcrates/ffi/src/api/scope_stack.rsfor the capture/restore bridge. The regression coverage is ingo/nemo_flow/atof_test.goandgo/nemo_flow/context_test.go.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
New Features
Tests