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

runner fixes and enhancements #2053

Merged
merged 5 commits into from
Sep 24, 2024
Merged

Conversation

madhur-ob
Copy link
Collaborator

This PR is inspired by a few ideas from

It also comes with:

  • storing json contents in runner attribute file
  • setting status as "timeout" if it occurs

loop = asyncio.get_running_loop()
loop.add_signal_handler(
signal.SIGINT,
lambda: self._handle_sigint(signum=signal.SIGINT, frame=None),

Choose a reason for hiding this comment

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

I think this would be better with asyncio.create_task and a wrapped async signal handler.

By using a synchronous one with time.sleep and subprocess.check_call, instead of awaiting on asyncio.sleep and asyncio.create_subprocess_exec, you're blocking other coroutines from running in the meantime.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @filipcacky, would you like to contribute this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you want, either you can push on top of my branch / fork..
OR we can merge this and you can raise another.. what say?

Choose a reason for hiding this comment

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

Hey, sorry, I'm from EU so it's a bit late for me 🙂 I've implemented this in async in my MR. You can copy it over from there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No worries, you can contribute tomorrow as discussed in DM 😄

Choose a reason for hiding this comment

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

Didn't have permissions to push/create PR to your remote, so I added my changes here filipcacky@5dd4aab. Feel free to cherry-pick.

metaflow/runner/utils.py Show resolved Hide resolved
metaflow/cli.py Show resolved Hide resolved
@savingoyal savingoyal merged commit cbfaea9 into Netflix:master Sep 24, 2024
26 checks passed
@madhur-ob madhur-ob deleted the runner-enhancements branch September 24, 2024 17:22
savingoyal added a commit that referenced this pull request Sep 24, 2024
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.

4 participants