Skip to content

Possible bug: NullReferenceException during request processing #727

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

Closed
YaLehin opened this issue Apr 24, 2020 · 4 comments · Fixed by #728
Closed

Possible bug: NullReferenceException during request processing #727

YaLehin opened this issue Apr 24, 2020 · 4 comments · Fixed by #728

Comments

@YaLehin
Copy link

YaLehin commented Apr 24, 2020

Description

If there are simultaneous requests to an app then sometimes there is NullReferenceException accrues while creation of FilterService. The currentRequest._resourceContex parameter of the constructor is null.
This error is not stable. In most cases, it occurs after the application is started. After some number of requests, it disappears. But if you restart the application it will be again.
I tried this on macOS system and not tried on windows.
...
To reproduce:
I found this in my project, but if you take the GettingStarted example the result will be the same. Start the GettingStarted project and run simultaneous requests. (For example, for nix like system:
$ echo http://localhost:5001/api/articles http://localhost:5001/api/articles | xargs -P 10 -n1 curl
)
There will be an exception.

Environment

  • Asp.Net Core 3.1
  • JsonApiDotNetCore Version: v.4.0.0-alpha4 or latest master branch
@bart-degreed
Copy link
Contributor

Thanks a lot for reporting this!
What JADNC version are you using?

@YaLehin
Copy link
Author

YaLehin commented Apr 24, 2020

Sorry, is JADNC abbreviation of JsonApiDotNetCore? :) If yes, then v4.0.0alpha4. I also tried the source from the master branch of this repo.

@bosk59
Copy link

bosk59 commented Apr 27, 2020

I confirm, same problem on same version.
Not a small bug ... For the moment we have contourned the problem by applying an attempt/retry mechanism at front side. Not an ideal way sure...

@bart-degreed
Copy link
Contributor

bart-degreed commented Apr 28, 2020

Serious bug indeed. I can repro this and believe I have found the root cause. Will work on a fix tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants