Comments (2)
Thanks for your attention @madelson!
from distributedlock.
@nelsoncvjr-stone thanks for the detailed report!
return new LockHandlerToken(handler, handler.HandleLostToken);
By accessing HandleLostToken
you're forcing the library to start proactively tracking the state of the underlying connection. However, it's not obvious from your code that you actually need this. I would suggest either removing the wrapper class or making the wrapper class access the token lazily so that you only pay this price when you are actually going to use the HandleLostToken in your caller.
I would like to know if this behavior is by design/expected by lib or not?
So far, I have not made "avoid UnobservedTaskException" a design constraint for this library. There are cases where the library spins off background tasks that could fail under normal conditions such as monitoring connection drops which might get interrupted by the application's desire to release the lock (and therefore close the connection).
In many cases, I've endeavored to minimize the overhead of thrown exceptions via an internal TryAwait()
method. However, this issue revealed to me that TryAwait()
was not properly observing the exception so it would still get reported as unobserved.
I've pushed a fix for that issue to the release-2.4
branch; it will be included in the next release of the library.
That said, I have not audited the entire library for other cases where UnobservedTaskException might fire spuriously; I'd welcome issues that identify more scenarios though.
from distributedlock.
Related Issues (20)
- Consider updating Azure.Storage.Blobs to latest once linked issue is resolved
- Rename CopyPackageToPublishDirectory.targets to Directory.Build.targets
- Using UseTransaction for SqlServer locks requires explicitly disabling UseMultiplexing
- RedisDistributedLock Releases Lock Prematurely Before ParallelMethod Completes HOT 7
- Redis timeout on RedLockRelease HOT 3
- IOException: directory already exists in Ubuntu
- Elaborate on ZooKeeper setup docs HOT 1
- Upgrade to NUnit 4 and leverage new features like Assert.ThatAsync and Assert.Multiple
- Use NUnit.Analyzers to prepare for migration to NUnit 4
- Add additional TFM so the dependency on System.Threading.AccessControl can be removed HOT 2
- Azure Semaphore implementation HOT 1
- Local development and CI using test containers HOT 5
- Dependency on Microsoft.Data.SqlClient 5.2.0 may be unnecessary HOT 3
- Postgres: Add support for transaction-scoped advisory locks with external DB connections HOT 5
- EventWaitHandle support for local namespace HOT 2
- Rare race condition with keepalive after upgrading to Npgsql 8.0.3
- Core Next Minor - normalize locking in DatabaseConnection.CreateCommand()
- Upgrade to Npgsql 8.0.3
- Take advantage of """ strings in various files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from distributedlock.