Skip to content

Prevent dangling cat-files … #17154

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

Closed
wants to merge 8 commits into from

Conversation

zeripath
Copy link
Contributor

In #17138 it appears that on Windows a git cat-file can fail to be killed.

This PR attempts to prevent this by:

  1. Using os.Pipes for the input - this should mean that the stdin is definitely closed.
  2. If the cat-file is doesn't close properly it will attempt to kill it repeatedly logging this.

Fix #17138

Signed-off-by: Andrew Thornton [email protected]

In go-gitea#17138 it appears that on Windows a git cat-file can fail to be killed.

This PR attempts to prevent this by:

1. Using os.Pipes for the input - this should mean that the stdin is definitely closed.
2. If the cat-file is doesn't close properly it will attempt to kill it repeatedly logging this.

Fix go-gitea#17138

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added type/bug pr/wip This PR is not ready for review backport/v1.15 labels Sep 25, 2021
@zeripath zeripath added this to the 1.16.0 milestone Sep 25, 2021
@zeripath
Copy link
Contributor Author

This is WIP because the current mechanism for killing processes is racy!

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 25, 2021
zeripath added a commit to zeripath/gitea that referenced this pull request Sep 25, 2021
Backport go-gitea#17154

In go-gitea#17138 it appears that on Windows a git cat-file can fail to be killed.

This PR attempts to prevent this by:

1. Using os.Pipes for the input - this should mean that the stdin is definitely closed.
2. If the cat-file is doesn't close properly it will attempt to kill it repeatedly logging this.

Fix go-gitea#17138

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath
Copy link
Contributor Author

Have I said how much I hate our linter?

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 25, 2021
@lafriks
Copy link
Member

lafriks commented Sep 25, 2021

data race detected

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 6, 2021
@tomaswarynyca
Copy link
Contributor

@zeripath is this RP considered ready?
Please resolve conflicts 💥

@zeripath
Copy link
Contributor Author

@tomaswarynyca unfortunately this doesn't seem to solve the issue and I'm kinda stuck with what other ideas to try.

@zeripath
Copy link
Contributor Author

I think #17125 may help us to detect what is really going on a bit better.

@zeripath
Copy link
Contributor Author

zeripath commented Nov 3, 2021

This doesn't work and the original issue appears to have solved itself.

@zeripath zeripath closed this Nov 3, 2021
@zeripath zeripath deleted the attempt-to-fix-17138 branch November 3, 2021 07:12
@zeripath zeripath removed this from the 1.16.0 milestone Nov 3, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. pr/wip This PR is not ready for review type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

always running processes from 1.15.3
5 participants