Skip to content
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

[KS-490] Support per-step timeout overrides in the Engine #15367

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

bolekk
Copy link
Contributor

@bolekk bolekk commented Nov 21, 2024

No description provided.

@bolekk bolekk requested a review from a team as a code owner November 21, 2024 16:02
Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

Copy link
Contributor

github-actions bot commented Nov 21, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@bolekk bolekk force-pushed the timeout_fix branch 2 times, most recently from 2136235 to 900c3c4 Compare November 21, 2024 16:29
@@ -27,7 +27,11 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/workflows/store"
)

const fifteenMinutesMs = 15 * 60 * 1000
const (
fifteenMinutesMs = 15 * 60 * 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use time.Duration to avoid an ambiguity?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's please use time.Duration wherever we can :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tradeoff is you cant use const as the time.Duration methods are runtime only

@@ -934,8 +949,11 @@ func (e *Engine) executeStep(ctx context.Context, lggr logger.Logger, msg stepRe
},
}

e.metrics.incrementCapabilityInvocationCounter(ctx)
output, err := step.capability.Execute(ctx, tr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Execute is syncronous, so this should not be a problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

@bolekk bolekk added this pull request to the merge queue Nov 21, 2024
Comment on lines +30 to +34
const (
fifteenMinutesMs = 15 * 60 * 1000
reservedFieldNameStepTimeout = "cre_step_timeout"
maxStepTimeoutOverrideSec = 10 * 60 // 10 minutes
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const (
fifteenMinutesMs = 15 * 60 * 1000
reservedFieldNameStepTimeout = "cre_step_timeout"
maxStepTimeoutOverrideSec = 10 * 60 // 10 minutes
)
var (
fifteenMinutesMs = 15 * time.Minute.Milliseconds()
reservedFieldNameStepTimeout = "cre_step_timeout"
maxStepTimeoutOverrideSec = 10 * time.Minute.Seconds()
)

@@ -919,6 +920,20 @@ func (e *Engine) executeStep(ctx context.Context, lggr logger.Logger, msg stepRe
if err != nil {
return nil, nil, err
}
stepTimeoutDuration := e.stepTimeoutDuration
if timeoutOverride, ok := config.Underlying[reservedFieldNameStepTimeout]; ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this config set per capability? Checking to make sure its not set at the workflow level

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, see example in the test file

Merged via the queue into develop with commit cb20337 Nov 21, 2024
145 of 146 checks passed
@bolekk bolekk deleted the timeout_fix branch November 21, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants