-
Notifications
You must be signed in to change notification settings - Fork 193
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
Upgrade npgsql (Postgres) to the very latest version #196
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
06da5b0
Close #111: Upgrade npgsql (Postgres) to the very latest version beca…
Bartleby2718 449d7e4
Drop support for net461 in all projects
Bartleby2718 e559c5c
Adjust Conditions to minimize churns around lock files
Bartleby2718 ae4de21
Add missing solution items for VS users
Bartleby2718 8366aef
Replace NET462 with NETFRAMEWORK in preprocessor directives
Bartleby2718 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,9 +153,7 @@ private async ValueTask<TResult> InternalExecuteAndPropagateCancellationAsync<TS | |
Invariant.Require(cancellationToken.CanBeCanceled); | ||
|
||
using var _ = await this.AcquireConnectionLockIfNeeded(isConnectionMonitoringQuery).ConfigureAwait(false); | ||
// Note: for now we cannot pass cancellationToken to PrepareAsync() because this will break on Postgres which | ||
// is the only db we currently support that needs Prepare currently. See https://github.com/npgsql/npgsql/issues/4209 | ||
await this.PrepareIfNeededAsync(CancellationToken.None).ConfigureAwait(false); | ||
await this.PrepareIfNeededAsync(cancellationToken).ConfigureAwait(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the only code change. I didn't add any comments because this is the expected behavior and the original behavior was an exception. |
||
try | ||
{ | ||
return await executeAsync(state, cancellationToken).ConfigureAwait(false); | ||
|
@@ -183,7 +181,7 @@ private ValueTask PrepareIfNeededAsync(CancellationToken cancellationToken) | |
{ | ||
return dbCommand.PrepareAsync(cancellationToken).AsValueTask(); | ||
} | ||
#elif !NETSTANDARD2_0 && !NET461 | ||
#elif !NETSTANDARD2_0 && !NETFRAMEWORK | ||
ERROR | ||
#endif | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open Question 1: In 78f3386, @madelson you built using the
Release
configuration and there were some changes inpackages.lock.json
files. This is because we have thisCondition
on line 8. The is the onlyCondition
inDirectory.Packages.props
that doesn't useTargetFramework
. Therefore, a normal build can cause a difference inpackages.lock.json
files based on theConfiguration
used for the build. Should we just get rid of thisCondition
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will cause other problems, unfortunately. If there was a way that we could install the analyzer every time and then use a condition to disable it for DEBUG that would be ideal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@madelson I did a little more research, which suggests that my proposed solution is actually a typical practice.
https://www.nuget.org/packages/Microsoft.CodeAnalysis.PublicApiAnalyzers/#usedby-body-tab lists 5 GitHub repositories that use this NuGet package:
None of the top 5 has a
Condition
onConfiguration
(including theItemGroup
s that contain thePackageReference
elements).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I'd have no issue with this in DEBUG, the problem is that this particular package does something weird in DistributedLock.Core to manage the pseudo-public dependencies (see for example this file). Because of that, if you run this analyzer in DEBUG it gets upset that those methods are not in the public API but they shouldn't be.
So this project is an atypical situation. Every project except DistributedLock.Core should be able to run this package in DEBUG with no issues.
If you're not convinced, you can try it and report back (put the package on in all configurations, then try command line and VS builds in both DEBUG and RELEASE configurations).
Like I said, one alternative would be to do the above, and then just conditionally suppress the warnings in DEBUG for DistributedLock.Core. That would be a nice solution if it can be made to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we multi-target TFMs in the test project based on
Configuration
, we're bound to have some lock files changes based onConfiguration
. Therefore, I think e559c5c looks best to me. With this, the only differences betweendotnet build -c Release
anddotnet build -c Debug
are lock files forDistributedLock.Core
andDistributedLock.Tests
, allowing us to minimize churns.