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 race input_file.go while closing the file and remove dead code. #764

Merged
merged 2 commits into from
Jun 4, 2020

Conversation

arijitAD
Copy link
Collaborator

@arijitAD arijitAD commented Jun 3, 2020

Currently, there is a race condition to close the input file in input_file.go, since fileInputReader.file is accessed by multiple go routine concurrently. This PR fixed the race when closing the input file by allowing the first caller to close and succeeding caller would be a no-op.

@arijitAD arijitAD requested review from buger, slimus and urbanishimwe June 3, 2020 17:08
Copy link
Collaborator

@slimus slimus left a comment

Choose a reason for hiding this comment

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

lgtm

@arijitAD arijitAD merged commit 766cb77 into master Jun 4, 2020
@urbanishimwe urbanishimwe deleted the fix-race-fileinput branch June 12, 2020 09:10
xingren23 referenced this pull request in xingren23/goreplay Sep 4, 2021
Fix race input_file.go while closing the file and remove dead code.
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

Successfully merging this pull request may close these issues.

2 participants