-
Notifications
You must be signed in to change notification settings - Fork 492
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
NullReferenceException in FeedIterator.ReadNextAsync #1004
Comments
By the way, |
This touched the code and renamed it to TryCreateXXX instead of CreateXXX. No idea if it fixed it, but just saying the 3.4.1 I'm using isn't the latest code: #943 |
Well this was annoying to debug. Ok, so here's what I've found so far. It is related to the use of a serializer, but it still seems to be a SDK bug. If I construct my client like this, everything works fine:
If I construct my client with a serializer like this, everything works fine FOR WINDOWS but crashes with a NotImplementedException in LINUX
The test query I'm doing has no results. In windows, the serializer is never called. In linux, it calls
However, I tried this, to see if JsonSerializer had some magic, but alas, no luck:
The value that's deserialized is not null. I do get a PartitionedQueryExecutionInfo. But calling ToString() on it yields: I suspect that the consumer of the object is hitting a NRE because of the nulls in the PartitionedQueryExecutionInfo. It seems this is probably related to #871 after all. Hopefully not a System.Text.Json bug :D |
Here's a minimal repo:
This is a .Net core 3.1 console app. With F5-debugging works, and outputs Build & run in linux docker container and It'll explode. |
Deepening the mystery... It does crash in windows when I'm running code in an XUnit test project, but not in an identical console app project. Both netcoreapp3.1. But I'm not sure that helps with this fix. |
Shallowifying the mystery... The problem occurrs in x86 mode only. NOT x64. This is why it runs in a console app (x64) but not in XUnit (x86). This is why it runs in our local dev environment on windows (x64) but not when deployed on linux in kubernetes (x86). While the mystery factor is now reduced, the WTF factor has increased. #974 ? |
After further investigation I'll be working on a fix for this. |
Is this gonna be in the next release by any chance? We still can't do any queries or use the change feed until it's fixed |
sorry for the delay. I got pulled to fix a few other bugs. I'm currently working on a PR to fix this issue. I don't know if it will make the next release. Once the PR is out and merged we can see about doing a hot fix for it. |
Using 3.4.1
I'm aware of this: #871 ... but this doesn't seem to be related to a serializer (although we do also use a custom serializer).
Our code is essentially:
Adding some debugging statements let us discover:
query.ToString()
yields{"query":"SELECT VALUE root FROM root WHERE ((root[\"Type\"] = \"Blockchain\") AND (NOT root[\"Deleted\"])) "}
Interestingly (sigh), the code works on dev machines (windows) but not when deployed (linux, kubernetes). Same database though. Other database calls do work, so it's not some weird access issue.
Stack trace:
Still investigating, but at this point I'm reasonably certain it's a sdk bug.
The text was updated successfully, but these errors were encountered: