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 task key computation #14704

Merged
merged 7 commits into from
Jul 22, 2024
Merged

Fix task key computation #14704

merged 7 commits into from
Jul 22, 2024

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Jul 22, 2024

closes #13735

this PR removes our reliance on the absolute path of the source file, which caused persistent cache misses due to source code being cloned to tmp dirs

the original issue was reported on a 2.x version - if this looks good I can backport this to 2.x

@github-actions github-actions bot added 2.x bug Something isn't working labels Jul 22, 2024
src/prefect/tasks.py Outdated Show resolved Hide resolved
@zzstoatzz zzstoatzz added 3.x and removed 2.x labels Jul 22, 2024
@github-actions github-actions bot added the 2.x label Jul 22, 2024
src/prefect/task_worker.py Outdated Show resolved Hide resolved
Copy link

codspeed-hq bot commented Jul 22, 2024

CodSpeed Performance Report

Merging #14704 will degrade performances by 11.46%

Comparing task-key-computation (e7d8691) with main (1299f1a)

Summary

❌ 1 regressions
✅ 4 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main task-key-computation Change
bench_task_decorator 434.7 µs 490.9 µs -11.46%

Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

One suggestion to move more logic into your utility function

src/prefect/tasks.py Outdated Show resolved Hide resolved
@zzstoatzz zzstoatzz force-pushed the task-key-computation branch from 2d3b1c4 to f8438c9 Compare July 22, 2024 20:47
@zzstoatzz zzstoatzz marked this pull request as ready for review July 22, 2024 20:48
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

@zzstoatzz zzstoatzz force-pushed the task-key-computation branch from 7c6efc9 to a63c9bd Compare July 22, 2024 21:43
src/prefect/tasks.py Outdated Show resolved Hide resolved
@zzstoatzz zzstoatzz merged commit c5f1970 into main Jul 22, 2024
31 of 32 checks passed
@zzstoatzz zzstoatzz deleted the task-key-computation branch July 22, 2024 23:06
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

LGTM, and the Codspeed tests are still new so we can merge without forcing that one benchmark to pass right now, especially given the variance and how tiny the "slowdown" is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x 3.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tasks with persisted results are running again on retry after Prefect 2.16.4
3 participants