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

[CAPL-264] Ensure a default timeout is provided for all outgoing requests #15644

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

agparadiso
Copy link
Contributor

@agparadiso agparadiso commented Dec 11, 2024

Description

This pr changes the way we handle timeouts for the outgoing connector handler adding a default timeout if one is not specified.

CAPL-264

Requires

Supports

Copy link
Contributor

github-actions bot commented Dec 11, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@agparadiso agparadiso force-pushed the CAPL-264_ensure_timeout_on_fetch branch from e191d14 to 86b3343 Compare December 12, 2024 10:35
@agparadiso agparadiso changed the title fix: ensure a default timeout is provided for all outgoing requests [CAPL-264] Ensure a default timeout is provided for all outgoing requests Dec 12, 2024
@agparadiso agparadiso force-pushed the CAPL-264_ensure_timeout_on_fetch branch from 86b3343 to 827b0d0 Compare December 12, 2024 13:02
// TODO: handle retries
func (c *OutgoingConnectorHandler) HandleSingleNodeRequest(ctx context.Context, messageID string, req capabilities.Request) (*api.Message, error) {
// set default timeout if not provided for all outgoing requests
if req.TimeoutMs == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

@agparadiso I know I didn't ask you to do this originally, but could we also create a subcontext with this timeout plus some margin added to it?

Atm we don't get a response from the gateway if we time out which causes some small bugs; if we add this, the context would fire on line 101 and we'd at least get a response.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added 👍🏼

@agparadiso agparadiso marked this pull request as ready for review December 12, 2024 14:24
@agparadiso agparadiso requested review from a team as code owners December 12, 2024 14:24
@justinkaseman justinkaseman added this pull request to the merge queue Dec 12, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 12, 2024
…ests (#15644)

* fix: ensure a default timeout is provided for all outgoing requests

* chore: add a subcontext with a timeout + margin

* fix: lint
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 12, 2024
@agparadiso agparadiso added this pull request to the merge queue Dec 13, 2024
Merged via the queue into develop with commit 38a9553 Dec 13, 2024
168 of 170 checks passed
@agparadiso agparadiso deleted the CAPL-264_ensure_timeout_on_fetch branch December 13, 2024 12:23
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