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

Remove unnecessary sync async compat code from flowspy #14766

Closed
wants to merge 1 commit into from

Conversation

cicdw
Copy link
Member

@cicdw cicdw commented Jul 25, 2024

I noticed in working on a bug that this code was unnecessarily wrapped in sync/async compatibility stuff so this PR removes it.

🧹 🧹 🧹

@cicdw cicdw added the development Tech debt, refactors, CI, tests, and other related work. label Jul 25, 2024
@cicdw cicdw requested a review from desertaxle July 25, 2024 23:53
Copy link

codspeed-hq bot commented Jul 26, 2024

CodSpeed Performance Report

Merging #14766 will not alter performance

Comparing remove-stale-sync-stuff (52f7e08) with main (b7cca3d)

Summary

✅ 5 untouched benchmarks

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.

I think load_flow_from_entrypoint has traditionally been called from a thread in async functions because it reads from disk when loading the flow. That disk access is likely fast enough that it's not worth the overhead and complexity of involving a thread in the cases where load_flow_from_entrypoint is used, so this LGTM!

@@ -1887,10 +1883,8 @@ async def load_flow_from_flow_run(
run_logger.debug(
f"Importing flow code from module path {deployment.entrypoint}"
)
flow = await run_sync_in_worker_thread(
Copy link
Member

Choose a reason for hiding this comment

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

I just remembered that I added some logic to run_sync_in_worker_thread to handle @sync_compatible functions at the module level (e.g. Block.load). We will likely need a new solution for that with this run_sync_in_worker_thread call removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, good test!! I'll poke at this and see if I can simplify the current code and if not, I'll just close this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Going to close for now, the refactors I've tried feel weird.

@cicdw cicdw closed this Jul 26, 2024
@cicdw cicdw deleted the remove-stale-sync-stuff branch July 26, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Tech debt, refactors, CI, tests, and other related work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants