Skip to content

fix: Attempt cleanup multiple times on Windows #161

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

Merged
merged 1 commit into from
Feb 4, 2022
Merged

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs self-assigned this Feb 4, 2022
@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #161 (f752fe4) into main (2eab1b5) will increase coverage by 0.07%.
The diff coverage is 43.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
+ Coverage   66.83%   66.91%   +0.07%     
==========================================
  Files         103      103              
  Lines        5120     5129       +9     
  Branches       68       68              
==========================================
+ Hits         3422     3432      +10     
+ Misses       1384     1383       -1     
  Partials      314      314              
Flag Coverage Δ
unittest-go-macos-latest 64.22% <43.75%> (+0.02%) ⬆️
unittest-go-ubuntu-latest 65.82% <43.75%> (+0.20%) ⬆️
unittest-go-windows-latest 63.88% <43.75%> (?)
unittest-js 64.21% <ø> (ø)
Impacted Files Coverage Δ
provisionerd/provisionerd.go 68.94% <43.75%> (-1.56%) ⬇️
peerbroker/dial.go 76.19% <0.00%> (-4.77%) ⬇️
peerbroker/listen.go 84.80% <0.00%> (+2.39%) ⬆️
peer/conn.go 80.51% <0.00%> (+2.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eab1b5...f752fe4. Read the comment docs.

Copy link
Contributor

@bryphe-coder bryphe-coder left a comment

Choose a reason for hiding this comment

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

Looks great - nice catch @kylecarbs

Unfortunately this is par for the course for windows... even a library on Node dedicated to wrapping all the fs APIs to handle this: https://github.com/isaacs/node-graceful-fs#improvements-over-fs-module

On Windows, it retries renaming a file for up to one second if EACCESS or EPERM error occurs, likely because antivirus software has locked the directory.

😬 😬

Comment on lines +227 to +230
// On Windows, open files cannot be removed.
// When the provisioner daemon is shutting down,
// it may take a few milliseconds for processes to exit.
// See: https://github.com/golang/go/issues/50510
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the descriptive comment to explain why this is needed!

@kylecarbs kylecarbs merged commit b6d27ad into main Feb 4, 2022
@kylecarbs kylecarbs deleted the provisionerclose branch February 4, 2022 17:54
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