Skip to content

fix(sandbox): prevent false-positive SIGKILL in SandboxWatchdog during heavy RPC #526

Description

@ZhuchkaTriplesix

Problem

The SandboxWatchdog sends a system.ping every 30 seconds and waits 5 seconds for a pong. If an extension (which usually runs on a single-threaded isolate) is busy serializing a massive JSON payload for a heavy SQL result, its Event Loop might be blocked for 6-8 seconds. The watchdog will interpret this as a deadlock and send a SIGKILL, crashing the extension prematurely.

Solution

Make the watchdog state-aware:

  1. Do not require pings/pongs when the plugin is explicitly in a BUSY state (e.g. currently processing an active RPC request).
  2. Or, significantly increase the pong timeout threshold (e.g., 15-20 seconds) to account for heavy serialization blocking the Dart event loop.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions