Skip to content

Conversation

@ben-grande
Copy link
Contributor

Requires: QubesOS/qubes-core-agent-linux#550


which I don't know how to indirectly timeout the subprocess created by run_service_for_stdio.

run_service_for_stdio can't do that for you, but run_service can - it returns subprocess instance on which you can wait yourself, including own timeout handling (like proc.communicate(timeout=...)).

I did that, but it seems that it is difficult to limit the amount of bytes that can be read as proc.communicate(timeout=1) is a blocking operation as well as proc.stdout.read(2)

To ensure a domU doesn't fill up Dom0 memory that is being assigned to untrusted_mem, something like this would have to be done: https://stackoverflow.com/a/34114767, unless someone knows a better solution.

@marmarek
Copy link
Member

is a blocking operation as well as proc.stdout.read(2)

Do you mean read() hangs for you? Maybe the service waits for something before starting to output any data (doesn't look like it based on the other PR...).

@ben-grande
Copy link
Contributor Author

ben-grande commented Jan 28, 2025 via email

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