Skip to content

feat: decrease the guard check interval, bump version #596

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

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

kemingy
Copy link
Member

@kemingy kemingy commented Nov 13, 2024

Previously, the GUARD_CHECK_INTERVAL = 1 will affect the shutdown time:

  • receive signal, set the shutdown to true
  • wait until the next check cycle to exit (sleep(GUARD_CHECK_INTERVAL))

This will get an average of 0.5s extra wait time to exit, which could be treated as an abnormal situation for users.

I have checked the average check time for that loop, it's about 0.05-0.09 ms. So decreasing it to 0.1s should be okay.

BTW, Python sys.getswitchinterval() is 5ms.

@kemingy kemingy requested a review from lkevinzc November 13, 2024 14:19
@github-actions github-actions bot added the enhancement New feature or request label Nov 13, 2024
@kemingy kemingy enabled auto-merge November 13, 2024 14:50
Copy link
Member

@lkevinzc lkevinzc left a comment

Choose a reason for hiding this comment

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

LGTM!

@kemingy kemingy added this pull request to the merge queue Nov 13, 2024
Merged via the queue into mosecorg:main with commit 03a5fdd Nov 13, 2024
19 checks passed
@kemingy kemingy deleted the check_interval branch November 13, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants