feat(core): Implement Sandboxed Execution (ENH-001)#25
Merged
Conversation
- Added l2sql.common.sandbox for Process Pool management - Refactored ExecutorNode, PhysicalValidatorNode, and OrchestratorVectorStore to use isolated pools - Updated README.md and Architecture Docs - Added ADR-001
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a robust sandboxing architecture for SQL execution and schema indexing, significantly improving crash isolation and reliability for the NL2SQL engine. The main changes include the addition of a global process pool manager for sandboxed execution, updates to the executor node to offload query execution to isolated processes, and documentation updates to reflect the new architecture and its operational invariants.
Sandboxed Execution Architecture
SandboxManagerinnl2sql/common/sandbox.pyto manage two global process pools: one for latency-sensitive SQL execution and another for high-throughput schema indexing. This ensures that unsafe operations (driver segfaults, OOMs) are isolated from the main application.nl2sql/common/settings.pyto configure the number of workers for both execution and indexing pools via environment variables.Executor Node Refactor
ExecutorNodeinnl2sql/pipeline/nodes/executor/node.pyto offload SQL execution to the sandboxed process pool. This includes re-instantiating adapters inside worker processes and handling worker crashes (segfaults, OOMs) with improved error reporting and safeguards. [1] [2] [3] [4]Documentation and Architectural Updates
README.mdto describe the new multi-plane architecture (Control, Security, Data), sandboxed execution, and system invariants such as "No Unvalidated SQL" and "Zero Shared State".docs/core/architecture.md,docs/core/nodes.md, anddocs/core/indexing.mdto detail the sandboxed execution model, process pool isolation, and how indexing and query execution are offloaded. [1] [2] [3]ADR-001_sandboxed_execution.md).Adapter SDK Update