generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: vastly improve development responsiveness and startup time (#1465)
There are two changes that contribute to this improvement: 1. Reduce most task reschedule timers to 1s. 2. Decrease runner/controller heartbeats to 1s. 3. Clear all transient database rows that slow down restarts - leases, runner/controller locks, etc. Fixes #1010 Fixes #1381
- Loading branch information
1 parent
f7fb7a6
commit c584822
Showing
11 changed files
with
434 additions
and
376 deletions.
There are no files selected for viewing
This file contains 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 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 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,33 @@ | ||
package dal | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
|
||
"github.com/TBD54566975/ftl/backend/controller/sql" | ||
"github.com/TBD54566975/ftl/backend/schema" | ||
) | ||
|
||
// SendFSMEvent sends an event to an executing instance of an FSM. | ||
// | ||
// If the instance doesn't exist a new one will be created. | ||
// | ||
// [name] is the name of the state machine to execute, [executionKey] is the | ||
// unique identifier for this execution of the FSM. | ||
// | ||
// Returns ErrConflict if the state machine is already executing. | ||
// | ||
// Note: this does not actually call the FSM, it just enqueues an async call for | ||
// future execution. | ||
// | ||
// Note: no validation of the FSM is performed. | ||
func (d *DAL) SendFSMEvent(ctx context.Context, name, executionKey, destinationState string, verb schema.Ref, request json.RawMessage) error { | ||
_, err := d.db.SendFSMEvent(ctx, sql.SendFSMEventParams{ | ||
Key: executionKey, | ||
Name: name, | ||
State: destinationState, | ||
Verb: verb, | ||
Request: request, | ||
}) | ||
return translatePGError(err) | ||
} |
This file contains 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.