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: wrap exec with timeout and _FROM env #96

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

xzchaoo
Copy link
Contributor

@xzchaoo xzchaoo commented Mar 18, 2024

Which issue does this PR close?

Closes #

Rationale for this change

The target process may hang and not exit for any reason.
We encountered this in practice. I guessed some reasons, but it was difficult to reproduce stably.

What changes are included in this PR?

  • wrapTimeout wraps cmd with timeout -s KILL <seconds> to prevent the process from hanging and not exiting for any reason.
  • wrapEnv wraps envs with _FROM=holoinsight-agent. This env is used to mark the source of the call.

Are there any user-facing changes?

How does this change test

@xzchaoo xzchaoo requested a review from sw1136562366 March 18, 2024 08:59
@xzchaoo xzchaoo self-assigned this Mar 18, 2024
@xzchaoo xzchaoo added the bug Something isn't working label Mar 18, 2024
Copy link
Collaborator

@sw1136562366 sw1136562366 left a comment

Choose a reason for hiding this comment

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

LGTM

@xzchaoo xzchaoo merged commit 4f9aeb9 into traas-stack:main Mar 18, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants