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

internal/plugintest: Switch from (os.File).Readdir() to os.ReadDir() #1056

Merged
merged 1 commit into from Sep 14, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Sep 12, 2022

Reference: https://pkg.go.dev/os#File.Readdir
Reference: https://pkg.go.dev/os#ReadDir

While attempting to troubleshoot macOS kernel panic behaviors while running acceptance testing, I was able to capture a log whose last entry was Symlinking source directories to work directory. Since that operation tends to occur in temporary directory space, there is at least some potential there for strange macOS and Go behaviors.

The (os.File).Readdir() method does make this mention in particular:

Most clients are better served by the more efficient ReadDir method.

Making this a branch so others potentially affected by macOS kernel panics can try this out. This may not be the root cause, as there is a lot more process-oriented logic that occurs to start and stop providers in the testing framework, but if nothing else it could help.

Reference: https://pkg.go.dev/os#File.Readdir
Reference: https://pkg.go.dev/os#ReadDir

While attempting to troubleshoot macOS kernel panic behaviors while running acceptance testing, I was able to capture a log whose last entry was `Symlinking source directories to work directory`. Since that operation tends to occur in temporary directory space, there is at least some potential there for strange macOS and Go behaviors.

The `(os.File).Readdir()` method does make this mention in particular:

> Most clients are better served by the more efficient ReadDir method.

Making this a branch so others potentially affected by macOS kernel panics can try this out. This may not be the root cause, as there is a lot more process-oriented logic that occurs to start and stop providers in the testing framework, but if nothing else it could help.
@bflad bflad added the bug Something isn't working label Sep 12, 2022
@bflad bflad requested a review from a team as a code owner September 12, 2022 13:50
@bflad bflad added technical-debt and removed bug Something isn't working labels Sep 14, 2022
@bflad
Copy link
Member Author

bflad commented Sep 14, 2022

While this doesn't appear to be fixing the kernel panics, I think this would still be a decent technical debt update since is recommended by the Go documentation and the code work is already done.

Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

Nice upgrade to have in place.

@bflad bflad added this to the v2.23.0 milestone Sep 14, 2022
@bflad bflad merged commit a096f3a into main Sep 14, 2022
@bflad bflad deleted the bflad/plugintest-symlinking branch September 14, 2022 13:11
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants