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

Move context cancellation of register trigger in cleanup loop #16675

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

george-dorin
Copy link
Contributor

This PR fixes a context management issue where premature context cancellation could close a gRPC streaming server (triggerExecutableClient) after trigger registration.

Copy link
Contributor

github-actions bot commented Mar 5, 2025

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.

🎖️ No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these.

Copy link
Contributor

github-actions bot commented Mar 5, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@george-dorin george-dorin marked this pull request as ready for review March 5, 2025 20:58
@george-dorin george-dorin requested review from a team as code owners March 5, 2025 20:58
@@ -162,16 +163,17 @@ func (p *triggerPublisher) Receive(_ context.Context, msg *types.MessageBody) {
}
ctx, cancel := p.stopCh.NewCtx()
callbackCh, err := p.underlying.RegisterTrigger(ctx, unmarshaled)
cancel()
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit/ Why do we handle the success case first? Same with the surrounding block. Usually the linter suggests error handling first, with a return, so that the subsequent logic can be inline instead of an indented block. Typically makes things much easier to read.

@george-dorin george-dorin added this pull request to the merge queue Mar 11, 2025
Merged via the queue into develop with commit 366e4a0 Mar 11, 2025
180 of 181 checks passed
@george-dorin george-dorin deleted the close-context-after-trigger-registration branch March 11, 2025 12:36
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.

3 participants