Skip to content

Commit ca34567

Browse files
committed
Add comment about not adding more signal reasons
1 parent aae67ff commit ca34567

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

agent/run_job.go

+12
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,23 @@ import (
2424
)
2525

2626
const (
27+
// Signal reasons
2728
SignalReasonAgentRefused = "agent_refused"
2829
SignalReasonAgentStop = "agent_stop"
2930
SignalReasonCancel = "cancel"
3031
SignalReasonSignatureRejected = "signature_rejected"
3132
SignalReasonProcessRunError = "process_run_error"
33+
// Don't add more signal reasons. If you must add a new signal reason, it must also be added to
34+
// the Job::Event::SignalReason enum in the rails app.
35+
//
36+
// They are meant to represent the reason a job was stopped, but they've also been used to
37+
// represent the reason a job wasn't started at all. This is fine but we don't want to pile more
38+
// on as customers catch these signal reasons when configuring retry attempts. When we add more
39+
// signal reasons we force customers to update their retry configurations to catch the new signal
40+
// reasons.
41+
//
42+
// We should consider adding new fields 'not_run_reason' and 'not_run_details' instead of adding
43+
// more signal reasons.
3244
)
3345

3446
type missingKeyError struct {

0 commit comments

Comments
 (0)