Install package may overlap with auto-restore #3836

Closed
alpaix opened this Issue Nov 1, 2016 · 1 comment

Comments

@alpaix

alpaix commented Nov 1, 2016

Follow up on NuGet/NuGet.Client#986.

Details about Problem

Install package runs restore/preview operation. This may overlap with auto-restore running in background. Potentially this may introduce dangerous race conditions as in current implementation there's no mutual blocking for these operations.

Suggested solution

Consider chaining install/uninstall package operations with auto-restore using the same mechanism employed by on-build/explicit restore.

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Nov 1, 2016

Contributor

Do not block your other fix on this issue.

Contributor

rrelyea commented Nov 1, 2016

Do not block your other fix on this issue.

@rrelyea rrelyea modified the milestones: 4.0 RC2, 4.0 RC Nov 1, 2016

@rrelyea rrelyea modified the milestones: 4.0 RC2, 4.0 RC3 Nov 29, 2016

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Dec 21, 2016

Lock NuGet operations in VS
The purpose of this change is to provide a solution for avoiding
overlapped NuGet operations within a VS session, such as
install/uninstall/update package and background restore.

Introducing `NuGetLockService`. Global service with straight-forward API
allowing obtaining a lock both in sync and async fashion.
Typical usage is:
```cs
using (var lck = await _lockService.AcquireLockAsync(token))
{
  ...
}
```

Among other changes are:
- Injected lock in restore worker, UI action engine and PS cmdlets.
- Shuffled code lines aroung to MEF import lock service where necessary.
-

Resolves NuGet/Home#3836.

@alpaix alpaix referenced this issue in NuGet/NuGet.Client Dec 21, 2016

Merged

Lock NuGet operations in VS #1071

alpaix added a commit to NuGet/NuGet.Client that referenced this issue Jan 4, 2017

Lock NuGet operations in VS
The purpose of this change is to provide a solution for avoiding
overlapped NuGet operations within a VS session, such as
install/uninstall/update package and background restore.

Introducing `NuGetLockService`. Global service with straight-forward API
allowing obtaining a lock both in sync and async fashion.
Typical usage is:
```cs
using (var lck = await _lockService.AcquireLockAsync(token))
{
  ...
}
```

Among other changes are:
- Injected lock in restore worker, UI action engine and PS cmdlets.
- Shuffled code lines aroung to MEF import lock service where necessary.
-

Resolves NuGet/Home#3836.

alpaix added a commit to alpaix/NuGet.Client that referenced this issue Jan 4, 2017

Lock NuGet operations in VS
The purpose of this change is to provide a solution for avoiding
overlapped NuGet operations within a VS session, such as
install/uninstall/update package and background restore.

Introducing `NuGetLockService`. Global service with straight-forward API
allowing obtaining a lock both in sync and async fashion.
Typical usage is:
```cs
using (var lck = await _lockService.AcquireLockAsync(token))
{
  ...
}
```

Among other changes are:
- Injected lock in restore worker, UI action engine and PS cmdlets.
- Shuffled code lines aroung to MEF import lock service where necessary.
-

Resolves NuGet/Home#3836.

mishra14 added a commit to NuGet/NuGet.Client that referenced this issue Jan 5, 2017

Lock NuGet operations in VS
The purpose of this change is to provide a solution for avoiding
overlapped NuGet operations within a VS session, such as
install/uninstall/update package and background restore.

Introducing `NuGetLockService`. Global service with straight-forward API
allowing obtaining a lock both in sync and async fashion.
Typical usage is:
```cs
using (var lck = await _lockService.AcquireLockAsync(token))
{
  ...
}
```

Among other changes are:
- Injected lock in restore worker, UI action engine and PS cmdlets.
- Shuffled code lines aroung to MEF import lock service where necessary.
-

Resolves NuGet/Home#3836.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment