-
Notifications
You must be signed in to change notification settings - Fork 220
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
Lefthook freezes under a large filesystem with constrained resources/security measures (GitLab CI/CD Shared Runners) #834
Comments
I'm not sure this is related, but I closed stdin in the CI script to enforce non-interactivity, and it seems Go/how you use |
Can you consider setting https://pkg.go.dev/[email protected]#File.SetReadDeadline on
|
Thank you for submitting this issue! When did you notice the freeze? Was it because of some lefthook configuration change, or CI runner changes? I think I could try setting read timeout, not sure it will fix the issue (it will probably fail the command). From the traces I see that lefthook waits for the data from the pseudo terminal. |
There was no change. Immediately as I defined this CI job with this image, the failure started to happen consistently. Unlike with other images, which run the exact same CI job and Lefthook config. |
I see, is there a way to reproduce this locally using Docker or something? Could you share the CI settings, like CPU and RAM available? |
@mrexox The CI Runner type (hardware) is based on a tag, it's on the right side of the CI job log I hyperlinked to. The images are public. However, the runners aren't that resource constrained I noticed. And it doesn't happen on my laptop. I think a security control or some unusual environmental factor, such as a closed terminal or so, causes this. Can you try to work out the pty robustness fixes in a PR? They would be good anyway, and maybe it's just that. I will test them for you if. |
🔧 Summary
I encounter 100 % reproducible freezes of our CI pipeline inside a ‘larger’ container image in a constrained CI environment. That are the discerning features, not OS or CPU ISA. The freeze doesn't occur on my laptop with the same image and filesystem.
Lefthook version
Version 1.7.16
Steps to reproduce
It can all be seen here https://gitlab.com/han-aim/template/base-images/-/jobs/8007847885
Expected results
Lefthook not freezing. It's not entirely clear to me whether all commands have been run before the freeze.
Actual results
A freeze. I generated a traceback after a delay to reach the frozen state:
Possible Solution
Either the filesystem is full or blocks an operation somehow (
io.Copy
activity) or some goroutine deadlock. I don't see why Lefthook itself would need to write to the filesystem.Logs / Screenshots
The text was updated successfully, but these errors were encountered: