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

fix(#3975): do not unref timeout #3977

Merged
merged 2 commits into from
Dec 31, 2024
Merged

fix(#3975): do not unref timeout #3977

merged 2 commits into from
Dec 31, 2024

Conversation

metcoder95
Copy link
Member

This relates to...

Closes #3975

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

@ronag ronag marked this pull request as ready for review December 31, 2024 08:15
Copy link
Member

@ronag ronag left a comment

Choose a reason for hiding this comment

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

It should inred if the request is aborted

@metcoder95
Copy link
Member Author

It should inred if the request is aborted

Do you mean to unref if the request can be aborted?
If the request was aborted, it will exit early and not reach the timeout 🤔

@ronag
Copy link
Member

ronag commented Dec 31, 2024

Consider the following case:

The retry timeout is active for another 60s. We wan't close the application by aborting all pending requests. With this change the application will continue hanging for 60s for no purpose.

Copy link
Member

@ronag ronag left a comment

Choose a reason for hiding this comment

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

Not perfect but probably better than current state of things...

@metcoder95
Copy link
Member Author

Ah ok yes, see now.
Let me see if I can set a workaround here

@metcoder95
Copy link
Member Author

It will require further thinking; I've tried to make it bare basic but it seems we are prone to several race conditions, so keeping it within the handler class might not sort out all the situations; let me spend more time on that later this week.

In the meanwhile, let's merge this one to unblock the issue and will continue further

@ronag ronag merged commit e51df14 into main Dec 31, 2024
36 of 37 checks passed
@Uzlopak Uzlopak deleted the fix/3975 branch December 31, 2024 18:19
@blinsay
Copy link

blinsay commented Dec 31, 2024

Appreciate the quick fix!

The retry timeout is active for another 60s. We wan't close the application by aborting all pending requests. With this change the application will continue hanging for 60s for no purpose.

Is destroy guaranteed to get called on the dispatcher in that scenario? Naively, it seems like stashing the timeout on the RetryHandler and deleting it on destroy seems appropriate. Not sure how hard that is though.

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.

RetryAgent doesn't keep the event loop alive
3 participants