NullReferenceException when using AsyncPool
See original GitHub issueI’m using FasterWrapper as suggested by https://github.com/microsoft/FASTER/issues/780#issuecomment-1383267812
But when running the following code, which checkpoints from multiple threads, I’m receving a NullReferenceException
at var status = session.Upsert(key, value);
Can you please explain why?
var faster = new FasterWrapper<long, long>(isRefType: false, useLargeLog: false, useOsReadBuffering: false);
await Task.WhenAll(Enumerable.Range(0, 2).Select(async i =>
{
faster.Upsert(i, i);
await faster.Store.TakeHybridLogCheckpointAsync(CheckpointType.FoldOver);
}));
I’ve also noticed in the synchronous variation of methods like Upsert
in FasterWrapper
, _sessionPool.GetAsync().GetAwaiter().GetResult()
is being used instead of the synchronous _sessionPool.Get()
, is there reason for that?
Issue Analytics
- State:
- Created 8 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why does async await throw a NullReferenceException?
Exception thrown inside killed my app with the NullReferenceException bec/ the method it was called from no longer existed.
Read more >C# Task - LazyAsyncResult - NullReferenceException
You are using async/await so when something goes wrong inside the auto-generated code to support this the debugger throws you into the framework ......
Read more >Async/Await Calls Gotcha with the CSharp ? Null Propagator
The first version works because null is a valid result for an expected result of a void method, or no result value from...
Read more >NullReferenceException when running an async test for . ...
After upgrading my .NET Core project from NUnit 3.5 to NUnit 3.6, I noticed that a failing Assert.That in an async test produces...
Read more >System.NullReferenceException is thrown when a ...
Hi Support,. An System.NullReferenceException: 'Object reference not set to an instance of an object.' is thrown by RichEditDocumentServer ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in https://github.com/microsoft/FASTER/pull/785
Reproduction:
public FasterKV<Key, Value> Store => _store;
fromFasterWrapper<Key, Value>
Main
method with above code as is.Exception:
The issue happens in v2.2.0 and v2.3.0 but not in v.2.1.0