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

sccache --stop-server does not block until the server has stopped #2237

Open
Snektron opened this issue Jul 25, 2024 · 3 comments
Open

sccache --stop-server does not block until the server has stopped #2237

Snektron opened this issue Jul 25, 2024 · 3 comments

Comments

@Snektron
Copy link

I'm using sccache in a CI environment, where at the start of the CI job the sccache server is first started and then stopped at the end. I'm running into some issues where the CI runtime (gitlab in this case) kills the CI job before the final object file is uploaded to the cache, as sccache --stop-server runs asynchronously. For now, I've solved this by manually waiting on the sccache process by running timeout 11 tail --pid=$(pgrep sccache) -f /dev/null right after invoking --stop-server, but it would be nice if there was a built-in method to do this. For example, something like sccache --stop-server-and-wait.

@just-an-engineer
Copy link

Hey, I just made a PR so you can specify server_shutdown_timeout_ms from the config file. This will let you set it to a crazy high number if you really wanted to, and allow any compile job to finish. Testing on my own machine, I found that if there was no job running, it would shut down immediately upon receiving the signal. But upon a long-running job, it would either wait for it to end and then stop, or timeout (which was previously a hardcoded default of 10 seconds).
Can you try it out and let me know if that fixes the issue, or if not, what's going on so I can help out more?

@just-an-engineer
Copy link

I marked it as a draft because I still need to add tests, which I'll do tonight. So if you want to do that today, you may need to switch over to my branch momentarily.

@Snektron
Copy link
Author

Can you try it out and let me know if that fixes the issue, or if not, what's going on so I can help out more?

Well not exactly: In my case the problem was not that the upload task was exceeding the timeout (though its very useful to be able to configure that), but that there is no built-in way to block the current shell until the background server has shut down.

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

No branches or pull requests

2 participants