Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Retry extraction of bundle to avoid issues with locked files by AV #7135

Merged
merged 2 commits into from
Jul 10, 2019

Conversation

vitek-karas
Copy link
Member

@vitek-karas vitek-karas commented Jul 9, 2019

Copy link

@lpereira lpereira left a comment

Choose a reason for hiding this comment

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

640KB50s should be enough for everybody.

Seems to be a robust workaround. Even though it's in a platform-independent area, this shouldn't affect platforms where AV software is less common (which, coincidentally, are also platforms where files can be moved around even if some process have them open.)

Copy link

@sdmaclea sdmaclea left a comment

Choose a reason for hiding this comment

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

500 tries at 100ms seems reasonable, but may depend a lot on the size of the bundle and the load on the machine.

Address some memory leaks
@AaronRobinsonMSFT AaronRobinsonMSFT marked this pull request as ready for review July 10, 2019 02:05
@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 552dba1 into dotnet:master Jul 10, 2019
@dasMulli
Copy link

50s is actually good, McAffee's default timeout for on-access scanning is 45s, so the files "should" be unlocked 45s after writing 🤞

@vitek-karas vitek-karas deleted the RetryExtraction branch July 30, 2019 07:45
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 8, 2019
The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 8, 2019
The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 8, 2019
The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 8, 2019
The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 8, 2019
The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 8, 2019
The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit that referenced this pull request Aug 8, 2019
* HostModel: Retry updates on IO error

The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
#7135

Fix for #7597
swaroop-sridhar added a commit to swaroop-sridhar/core-setup that referenced this pull request Aug 9, 2019
* HostModel: Retry updates on IO error

The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet#7135

Fix for #7597
swaroop-sridhar added a commit that referenced this pull request Aug 13, 2019
* HostModel: Retry updates on IO error (#7617)

The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations. An Antivirus scanner may intercept in-between and cause these operations to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
#7135

On Win32 PE files, the SDK copies resources on the AppHost binary from the intermediate assembly.

This update is performed using native Win32 operations. This change also adds retries to the resource update, if the operation fails because the file is locked (say because of AntiVirus scan).

The Retry logic is factored out to the RetryUtil class. Currently the HostWriter is the only client for the class. But it is made public because other components (like Bundler) may use it in future.
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…otnet/core-setup#7135)

Retry extraction of bundle to avoid issues with locked files by AV software
Address some memory leaks


Commit migrated from dotnet/core-setup@552dba1
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* HostModel: Retry updates on IO error

The HostModel implements services for updating the AppHost DLL
- Write App-dll name
- Set GUI/CUI bit
- Read/Write BundleHeader marker

These updates involve multiple file open/close operations.
An Antivirus scanner may intercept in-between and cause these operations
to fail with IO-Error.

So, this change adds a few retries to the IO operations, similar to
dotnet/core-setup#7135

Fix for dotnet/core-setup#7597


Commit migrated from dotnet/core-setup@f19be99
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants