Skip to content

Commit

Permalink
Bug fix: change interruptible order in platform shutdown flow (#4539)
Browse files Browse the repository at this point in the history
  • Loading branch information
schickling authored Mar 3, 2025
1 parent 0d01480 commit 99fcbf7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/popular-ducks-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@effect/platform-node": patch
"@effect/platform-bun": patch
---

Fixed interruption of timeout in worker shutdown
2 changes: 1 addition & 1 deletion packages/platform-bun/src/internal/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const platformWorkerImpl = Worker.makePlatform<globalThis.Worker>()({
worker.postMessage([1])
return Deferred.await(closeDeferred)
}).pipe(
Effect.interruptible,
Effect.timeout(5000),
Effect.interruptible,
Effect.catchAllCause(() => Effect.sync(() => worker.terminate()))
)
),
Expand Down
2 changes: 1 addition & 1 deletion packages/platform-node/src/internal/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const platformWorkerImpl = Worker.makePlatform<WorkerThreads.Worker>()({
worker.postMessage([1])
return Deferred.await(exitDeferred)
}).pipe(
Effect.interruptible,
Effect.timeout(5000),
Effect.interruptible,
Effect.catchAllCause(() => Effect.sync(() => worker.terminate()))
)
),
Expand Down

0 comments on commit 99fcbf7

Please sign in to comment.