Skip to content

Remove unnecessary busy threads reading from processes stdout/stderr #1672

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ansys-akarcher
Copy link
Contributor

this PR does not fix anything in particular.

From looking at the code it seems like, when a gRPC server is created, two threads will be started until the server dies, especially if the server startup is successful.

I think the behavior can be kept without the existence of these two threads, as the general approach is: block until the server startup is successful, or an error is detected, or server has not started and time has ran out.

Current modification do not work with server within docker context.


# Detect when server is started
if stdout_line != None and "server started" in stdout_line:
started = True
Copy link
Contributor

Choose a reason for hiding this comment

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

@ansys-akarcher shouldn't we also break?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was wondering about that also

I don't know if it would be possible to have "server started" and some stderr output

in this case the behavior would be different (breaking would wrongly set started as True, skipping any errors)

@PProfizi
Copy link
Contributor

Hi @ansys-akarcher is this still ongoing work?

@ansys-akarcher
Copy link
Contributor Author

@PProfizi the changes were insufficient, as there was also the docker context to take into account.

But yeah I'd like to complete these changes at some point

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