-
-
Notifications
You must be signed in to change notification settings - Fork 711
Fix controller waitpoint resolution, suspendable state, and snapshot race conditions #2006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 64 commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
b384dad
remove dead code
nicktrn 082926a
rename managed to shared runtime manager
nicktrn 786416c
rename to resolve waitpoint for clarity
nicktrn b5ae558
add resolver id helper
nicktrn 4d46d20
store and correctly resolve waipoints that come in early
nicktrn e72bcc8
fix ipc message type change
nicktrn 38273ae
branded type for resolver ids
nicktrn f190420
add fixme comments
nicktrn 3592db2
remove more unused ipc schemas
nicktrn d6dfc66
Merge remote-tracking branch 'origin/main' into fix/resolve-waitpoints
nicktrn b13d8b7
fix entitlement validation when client doesn't exist
nicktrn 3cb44a1
restore hello world reference workspace imports
nicktrn 9e2729c
runtime manager debug logs
nicktrn 752770f
prefix engine run logs
nicktrn 5f52292
managed run logger accepts nested props
nicktrn bb9ac50
runtime suspendable state and improved logs
nicktrn 3d978d3
require suspendable state for checkpoints, fix snapshot processing queue
nicktrn 63b3bc0
Merge remote-tracking branch 'origin/main' into fix/resolve-waitpoints
nicktrn 479c304
add terminal link as cli module so we can more easily patch it
nicktrn a053114
apply cursor patch
nicktrn c3333ab
add license info
nicktrn 8bc2e33
remove terminal-link package and add deprecation notice
nicktrn 784e151
remove old patch
nicktrn 641ca67
remove terminal-link from sdk
nicktrn ccd9e5b
rename snapshot module
nicktrn f62047b
add cli test tsconfig
nicktrn c3dbb8a
add run logger base type
nicktrn 140e2d7
add snapshot manager tests
nicktrn 8df5122
Merge branch 'fix/terminal-links' into fix/resolve-waitpoints
nicktrn ddb40ae
fix cli builds
nicktrn 0ed24db
Merge remote-tracking branch 'origin/main' into fix/resolve-waitpoints
nicktrn 54db582
improve QUEUED_EXECUTING test
nicktrn b17a947
changeset
nicktrn 9292667
Merge remote-tracking branch 'origin/main' into fix/resolve-waitpoints
nicktrn 68ea4c4
make testcontainers wait until container has stopped
nicktrn c36e274
require unit tests for publishing again
nicktrn 87b0ce1
avoid mutation during iteration when resolving pending waitpoints
nicktrn 2622b0d
improve debug logs and make them less noisy
nicktrn ffa2a73
always update poller snapshot id for accurate logs
nicktrn 7a37a26
detach task run process handlers
nicktrn 55b835d
Merge remote-tracking branch 'origin/main' into fix/resolve-waitpoints
nicktrn 8fd09e3
check for env overrides in a few more places and add verbose logs
nicktrn da24a79
log when poller is still executing when we stop it
nicktrn c62cf10
add supervisor to publish workflow
nicktrn 467f9de
always print full deploy logs in CI
nicktrn 246c1a9
Revert "avoid mutation during iteration when resolving pending waitpo…
nicktrn 9403409
disable pre
nicktrn 4607b05
print prerelease script errors
nicktrn ed1a44c
Revert "disable pre"
nicktrn 213a983
misc fixes
nicktrn 344e2e5
better debug logs
nicktrn cc0feb0
Merge remote-tracking branch 'origin/main' into fix/resolve-waitpoints
nicktrn b4c61af
add snapshots since methods and route
nicktrn a7e4ddd
prep for snapshots since
nicktrn 52a57a4
improve deprecated execution detection
nicktrn 16b344d
update supervisor and schema
nicktrn b09178a
properly log http server errors
nicktrn 59d9784
detect restore after failed snapshot fetch
nicktrn e26dcb2
run and snapshot id can be overridden
nicktrn 7c1a816
fix restore detection
nicktrn 6b16df0
fix deprecation checks, move into snapshot manager
nicktrn 2c8bcc2
less logs
nicktrn 1ce6ddc
rename snapshot manager stop
nicktrn 188a023
restore detection was moved into snapshot manager
nicktrn 4a27eea
fix notifier logs
nicktrn 8c3da69
make runtime manager status a debug log
nicktrn bd8efa7
no need to attach runtime status twice
nicktrn 997185c
findUnique -> findFirst
nicktrn 6769aeb
sort snapshots by created at everywhere
nicktrn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"trigger.dev": patch | ||
"@trigger.dev/core": patch | ||
--- | ||
|
||
- Correctly resolve waitpoints that come in early | ||
- Ensure correct state before requesting suspension | ||
- Fix race conditions in snapshot processing |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"trigger.dev": patch | ||
--- | ||
|
||
Always print full deploy logs in CI |
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
30 changes: 30 additions & 0 deletions
30
...pp/app/routes/engine.v1.worker-actions.runs.$runFriendlyId.snapshots.since.$snapshotId.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { json, TypedResponse } from "@remix-run/server-runtime"; | ||
import { WorkerApiRunSnapshotsSinceResponseBody } from "@trigger.dev/core/v3/workers"; | ||
import { z } from "zod"; | ||
import { createLoaderWorkerApiRoute } from "~/services/routeBuilders/apiBuilder.server"; | ||
|
||
export const loader = createLoaderWorkerApiRoute( | ||
{ | ||
params: z.object({ | ||
runFriendlyId: z.string(), | ||
snapshotId: z.string(), | ||
}), | ||
}, | ||
async ({ | ||
authenticatedWorker, | ||
params, | ||
}): Promise<TypedResponse<WorkerApiRunSnapshotsSinceResponseBody>> => { | ||
const { runFriendlyId, snapshotId } = params; | ||
|
||
const snapshots = await authenticatedWorker.getSnapshotsSince({ | ||
runFriendlyId, | ||
snapshotId, | ||
}); | ||
|
||
if (!snapshots) { | ||
throw new Error("Failed to retrieve snapshots since given snapshot"); | ||
} | ||
|
||
return json({ snapshots }); | ||
} | ||
); |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.