-
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
Changes from 2 commits
06da5b0
449d7e4
e559c5c
ae4de21
8366aef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"version": 2, | ||
"dependencies": { | ||
".NETFramework,Version=v4.6.1": { | ||
".NETFramework,Version=v4.6.2": { | ||
"Azure.Storage.Blobs": { | ||
"type": "Direct", | ||
"requested": "[12.19.1, )", | ||
|
@@ -12,19 +12,13 @@ | |
"System.Text.Json": "4.7.2" | ||
} | ||
}, | ||
"Microsoft.CodeAnalysis.PublicApiAnalyzers": { | ||
"type": "Direct", | ||
"requested": "[3.3.4, )", | ||
"resolved": "3.3.4", | ||
"contentHash": "kNLTfXtXUWDHVt5iaPkkiPuyHYlMgLI6SOFT4w88bfeI2vqSeGgHunFkdvlaCM8RDfcY0t2+jnesQtidRJJ/DA==" | ||
}, | ||
"Microsoft.NETFramework.ReferenceAssemblies": { | ||
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 was added in 78f3386, but I'm not sure why this was a direct dependency. Maybe your VS is set up in a certain way? 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. Yeah not sure. This came in when I built. I'm OK with some thrash here. |
||
"type": "Direct", | ||
"requested": "[1.0.3, )", | ||
"resolved": "1.0.3", | ||
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", | ||
"dependencies": { | ||
"Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" | ||
"Microsoft.NETFramework.ReferenceAssemblies.net462": "1.0.3" | ||
} | ||
}, | ||
"Microsoft.SourceLink.GitHub": { | ||
|
@@ -67,10 +61,10 @@ | |
"resolved": "1.0.0", | ||
"contentHash": "z2fpmmt+1Jfl+ZnBki9nSP08S1/tbEOxFdsK1rSR+LBehIJz1Xv9/6qOOoGNqlwnAGGVGis1Oj6S8Kt9COEYlQ==" | ||
}, | ||
"Microsoft.NETFramework.ReferenceAssemblies.net461": { | ||
"Microsoft.NETFramework.ReferenceAssemblies.net462": { | ||
"type": "Transitive", | ||
"resolved": "1.0.3", | ||
"contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" | ||
"contentHash": "IzAV30z22ESCeQfxP29oVf4qEo8fBGXLXSU6oacv/9Iqe6PzgHDKCaWfwMBak7bSJQM0F5boXWoZS+kChztRIQ==" | ||
}, | ||
"Microsoft.SourceLink.Common": { | ||
"type": "Transitive", | ||
|
@@ -204,15 +198,15 @@ | |
"distributedlock.core": { | ||
"type": "Project", | ||
"dependencies": { | ||
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0, )", | ||
"Microsoft.Bcl.AsyncInterfaces": "[8.0.0, )", | ||
"System.ValueTuple": "[4.5.0, )" | ||
} | ||
}, | ||
"Microsoft.Bcl.AsyncInterfaces": { | ||
"type": "CentralTransitive", | ||
"requested": "[5.0.0, )", | ||
"resolved": "5.0.0", | ||
"contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", | ||
"requested": "[8.0.0, )", | ||
"resolved": "8.0.0", | ||
"contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", | ||
"dependencies": { | ||
"System.Threading.Tasks.Extensions": "4.5.4" | ||
} | ||
|
@@ -235,12 +229,6 @@ | |
"System.Text.Json": "4.7.2" | ||
} | ||
}, | ||
"Microsoft.CodeAnalysis.PublicApiAnalyzers": { | ||
"type": "Direct", | ||
"requested": "[3.3.4, )", | ||
"resolved": "3.3.4", | ||
"contentHash": "kNLTfXtXUWDHVt5iaPkkiPuyHYlMgLI6SOFT4w88bfeI2vqSeGgHunFkdvlaCM8RDfcY0t2+jnesQtidRJJ/DA==" | ||
}, | ||
"Microsoft.SourceLink.GitHub": { | ||
"type": "Direct", | ||
"requested": "[1.0.0, )", | ||
|
@@ -384,14 +372,14 @@ | |
"distributedlock.core": { | ||
"type": "Project", | ||
"dependencies": { | ||
"Microsoft.Bcl.AsyncInterfaces": "[5.0.0, )" | ||
"Microsoft.Bcl.AsyncInterfaces": "[8.0.0, )" | ||
} | ||
}, | ||
"Microsoft.Bcl.AsyncInterfaces": { | ||
"type": "CentralTransitive", | ||
"requested": "[5.0.0, )", | ||
"resolved": "5.0.0", | ||
"contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", | ||
"requested": "[8.0.0, )", | ||
"resolved": "8.0.0", | ||
"contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", | ||
"dependencies": { | ||
"System.Threading.Tasks.Extensions": "4.5.4" | ||
} | ||
|
@@ -408,12 +396,6 @@ | |
"System.Text.Json": "4.7.2" | ||
} | ||
}, | ||
"Microsoft.CodeAnalysis.PublicApiAnalyzers": { | ||
"type": "Direct", | ||
"requested": "[3.3.4, )", | ||
"resolved": "3.3.4", | ||
"contentHash": "kNLTfXtXUWDHVt5iaPkkiPuyHYlMgLI6SOFT4w88bfeI2vqSeGgHunFkdvlaCM8RDfcY0t2+jnesQtidRJJ/DA==" | ||
}, | ||
"Microsoft.SourceLink.GitHub": { | ||
"type": "Direct", | ||
"requested": "[1.0.0, )", | ||
|
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 && !NET462 | ||
Bartleby2718 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ERROR | ||
#endif | ||
|
||
|
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.