-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[rfc] Add client timeout for schedules/sensors #17831
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
16a2eee
to
14e47d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment on min/max of timeouts
# 3. By the client. | ||
# The timeout argument of this function takes into account (1) and (2), while | ||
# the client may pass a timeout argument via the | ||
# `external_schedule_execution_args` object. We take the maximum of all of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assume that the timeout would be sensitive, in that stricter timeout (e.g. coming from the client) should always be respected, even if the server timeout is higher.
So shouldn't we be taking the minimum of all these timeouts?
(I may be confusing this setting with our previous conversation today about setting per-sensor timeouts)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal here is to allow the client to set a higher timeout, in cases where the env var cannot be set. If we take the minimum, then we'll always end up using the current 60s window provided by the grpc call itself at most.
Perhaps an alternative is to, instead of taking the max or min, always defer to the value set on the client if provided, and then otherwise use the default. That way, max or min will be respected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to always defer to the timeout set on the client, which should allow for tighter client timeouts as well.
14e47d0
to
92f5396
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems ok to me with the addition of tests (plus the change suggested inline where we take out the unused argument to the function)
92f5396
to
005642a
Compare
Deploy preview for dagit-storybook ready! ✅ Preview Built with commit 11aa374. |
Deploy preview for dagit-core-storybook ready! ✅ Preview Built with commit ab8c7db. |
005642a
to
aef3b6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also add something that tests the case where you have both the env var set and the client setting set and the env var is ignored?
timeout = ( | ||
external_schedule_execution_args.timeout | ||
if external_schedule_execution_args.timeout is not None | ||
else DEFAULT_SCHEDULE_GRPC_TIMEOUT | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overriding if it's explicitly set seem reasonable to me - we will want to avoid changing the default behavior for folks who have the env var set - so as long as its something you explicitly opt into and we don't, for example, set the default client setting to 60 for everybody and potentially break folks who have the env var set
aef3b6a
to
8ba53e8
Compare
Deploy preview for dagster-university ready! ✅ Preview Built with commit 8ba53e8. |
8ba53e8
to
11aa374
Compare
11aa374
to
ab8c7db
Compare
Allows timeout retrieval from the execution args for schedules/sensors.
This provides a pathway for providing per-sensor timeouts, or in general, specifying timeout at the client.