Skip to content

Commit 8a5d275

Browse files
authored
Fix Flaky PID Retrieval (#296)
* testing circuit breaker * update lock * update docs * improve PID management in Session class * revert circuit and queue changes * use wait for in the test * Fix race condition for PID retrieval Updated the changeset to fix a race condition during PID retrieval.
1 parent b56b66b commit 8a5d275

File tree

5 files changed

+178
-13
lines changed

5 files changed

+178
-13
lines changed

.changeset/clean-pans-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/sandbox": patch
3+
---
4+
5+
fix race condition for PID retrieval

package-lock.json

Lines changed: 31 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sandbox-container/src/services/process-service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export class ProcessService {
151151
async (event) => {
152152
// Route events to process record listeners
153153
if (event.type === 'start' && event.pid !== undefined) {
154+
processRecord.pid = event.pid;
154155
await this.store.update(processRecord.id, { pid: event.pid });
155156
} else if (event.type === 'stdout' && event.data) {
156157
processRecord.stdout += event.data;

0 commit comments

Comments
 (0)