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 issue where run_command blocks when it shouldn't #2169

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

romain-intel
Copy link
Contributor

In cases where we need to read from a file (for the result of run_command), the current code used to make it sequential (so the timeout was actually never triggered).

This started causing problems on MacOS when writing large amounts of data (8KB FIFO)

In cases where we need to read from a file (for the result of run_command),
the current code used to make it sequential (so the timeout was actually never triggered).

This started causing problems on MacOS when writing large amounts of data (8KB FIFO)
@@ -326,6 +326,7 @@ def run(self, **kwargs) -> ExecutingRun:
show_output=self.show_output,
)
command_obj = self.spm.get(pid)
command_obj.sync_wait()

return self.__get_executing_run(attribute_file_fd, command_obj)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess command_obj.sync_wait() for Runner should happen inside self.__get_executing_run since we wanna do it after content = handle_timeout(...)

@@ -357,6 +358,7 @@ def resume(self, **kwargs):
show_output=self.show_output,
)
command_obj = self.spm.get(pid)
command_obj.sync_wait()
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment here

@romain-intel romain-intel merged commit 12c97e3 into master Dec 10, 2024
29 checks passed
@romain-intel romain-intel deleted the fix/run_command_wait branch December 10, 2024 07:42
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.

2 participants