You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Major fix: deadline computation for enqueued workflows. Previously we'd
actually set the deadline when the workflow was enqueued, not dequeued.
This PR fixes it by considering the timeout when setting the final
deadline. (Note: we also revert the change from #53 and let
`resumeWorkflow` clear the deadline. It'll be recomputed from the
timeout in `RunAsWorkflow`.)
Also:
- Add a test `TimeoutOnlySetOnDequeue`, to verify the above fix
- Record a workflow error when the function is called with the wrong
parameter types. This could happen if the client enqueues a workflow
with the wrong input type.
- Prevent the spawning of child workflows within steps and add a test
(`ChildWorkflowCannotBeSpawnedFromStep`)
- Add a GHA to perform vulnerability checks and static analysis
- Set toolchain to 1.25 (and update test GHA accordingly). Note this is
*not* the minimum version required by library consumers.
- Run `go vet` in test GHA
- Add "join discord" badge to README
- Make hardcoded values package level constants
- Fix a small bug where returning the admin server object would be
missing the port
- Handle errors when writing the response in the healthcheck admin
endpoint
- Set `ReadHeaderTimeout` on the admin server to prevent Slowloris
attacks
- Handle sub millisecond timeouts (round to next millisecond)
- Handle negative timeouts (can happen with propagation delays): set
timeout to 1ms
- Use a sync.Map for the workflow registry
- Check the executable is a regular file before opening it to compute
its hash
- Remove unused WorkflowFunctionNotFound -- I don't see a use case for
it
- Use `struct{}{}` instead of `bool` for notification channels
(`struct{}{}` use zero space)
- Use an input struct for `dequeueWorkflows`
- Cleanup handles implementation with a base handler that implement once
shared logic (`GetStatus`, `GetWorkflowID`). other handles compose with
this struct.
- Handle errors when failing to close notification listener connection
- Handle error when closing the connection used to set `LISTEN` channels
in Postgres
- Handle errors (and print a log entry) when failing to run a scheduled
workflow
- Fix possible integer overflows when converting uint to int (for queue
priorities and fork start step)
- Complete DLQ test: resume the DLQ-ed workflow and check it can now run
to completion. Check that the completed workflow can be ran many times
past the retry limit.
- Pass `workflowCustomNametoFQN` to new contexts
// Verify the deadline was reset (should be different from original)
474
474
assert.False(t, resumeStatus.Deadline.Equal(originalDeadline), "expected deadline to be reset after resume, but it remained the same: %v", originalDeadline)
475
475
476
-
// The new deadline should be after resumeStart + workflowTimeout
477
-
expectedDeadline:=resumeStart.Add(workflowTimeout-100*time.Millisecond) // Allow some leeway for processing time
478
-
assert.True(t, resumeStatus.Deadline.After(expectedDeadline), "deadline %v is too early (expected around %v)", resumeStatus.Deadline, expectedDeadline)
479
-
480
476
// Wait for the workflow to complete
481
477
_, err=resumeHandle.GetResult()
482
478
require.Error(t, err, "expected timeout error, but got none")
Copy file name to clipboardExpand all lines: dbos/dbos.go
+50-37Lines changed: 50 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ import (
15
15
"io"
16
16
"log/slog"
17
17
"os"
18
+
"path/filepath"
18
19
"sync"
19
20
"sync/atomic"
20
21
"time"
@@ -119,10 +120,9 @@ type dbosContext struct {
119
120
// Wait group for workflow goroutines
120
121
workflowsWg*sync.WaitGroup
121
122
122
-
// Workflow registry
123
-
workflowRegistrymap[string]workflowRegistryEntry
124
-
workflowRegMutex*sync.RWMutex
125
-
workflowCustomNametoFQN sync.Map// Maps fully qualified workflow names to custom names. Usefor when client enqueues a workflow by name because registry is indexed by FQN.
123
+
// Workflow registry - read-mostly sync.Map since registration happens only before launch
workflowCustomNametoFQN*sync.Map// Maps fully qualified workflow names to custom names. Usefor when client enqueues a workflow by name because registry is indexed by FQN.
0 commit comments