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

update idempotency key for scheduled runs to disambiguate schedules #17123

Merged
merged 4 commits into from
Feb 13, 2025

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Feb 13, 2025

closes #17115

using the MRE in the linked issue we see that we were clobbering scheduled runs bc the idempotency key didn't consider uniqueness wrt deployment schedule id

before

image

after

image

also defers fixing get_client overloads and type errors in _result_records that have started failing on main

@github-actions github-actions bot added the bug Something isn't working label Feb 13, 2025
Copy link

codspeed-hq bot commented Feb 13, 2025

CodSpeed Performance Report

Merging #17123 will not alter performance

Comparing fix-many-schedule (a90ebf5) with main (2df84e4)

Summary

✅ 2 untouched benchmarks

@zzstoatzz zzstoatzz added the fix A fix for a bug in an existing feature label Feb 13, 2025
accept defeat
@zzstoatzz zzstoatzz marked this pull request as ready for review February 13, 2025 02:00
@zzstoatzz zzstoatzz self-assigned this Feb 13, 2025
@zzstoatzz zzstoatzz changed the title update idempotency key when deployment schedule has parameters update idempotency key for scheduled runs to disambiguate schedules Feb 13, 2025
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

A few nits, but the fix looks good!

Comment on lines 147 to 148
def coerce_old_format(cls, value: dict[str, Any]) -> dict[str, Any]:
if isinstance(value, dict): # type: ignore[reportUnnecessaryIsInstance]
Copy link
Member

Choose a reason for hiding this comment

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

I think it's worthwhile to keep this typing since the value can be Any.

@@ -149,7 +149,7 @@


@overload
def get_client(
def get_client( # type: ignore # TODO
Copy link
Member

Choose a reason for hiding this comment

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

This should be fixed when we merge the pyproject migration.

Comment on lines 233 to 235
if not isinstance(other, ResultRecord):
return False
return self.metadata == other.metadata and self.result == other.result
return self.metadata == other.metadata and self.result == other.result # type: ignore[reportUnknownVariableType]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can flip the conditional to appease pyright?

if isinstance(other, ResultRecord):
    return self.metadata == other.metadata and self.result == other.result
else:
    return False

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm that didn't work, but a model_dump(include did!

@zzstoatzz
Copy link
Collaborator Author

@zzstoatzz zzstoatzz merged commit 6c3ee1f into main Feb 13, 2025
45 of 46 checks passed
@zzstoatzz zzstoatzz deleted the fix-many-schedule branch February 13, 2025 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix A fix for a bug in an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flows with multiple schedules at the same time are only scheduled once
2 participants