Fix NRE in RavenDb durability recovery#2555
Merged
jeremydmiller merged 1 commit intoJasperFx:mainfrom Apr 21, 2026
Merged
Conversation
c720273 to
c546419
Compare
jeremydmiller
approved these changes
Apr 21, 2026
Member
jeremydmiller
left a comment
There was a problem hiding this comment.
Thanks for the clean fix and regression test.
4 tasks
dmytro-pryvedeniuk
pushed a commit
to dmytro-pryvedeniuk/wolverine
that referenced
this pull request
Apr 22, 2026
Adds a CIRavenDb Nuke target that builds and exercises both RavenDbTests and RavenDbTests.LeaderElection one class (or one method, for leader election) at a time with retry, plus a dedicated GitHub Actions workflow. RavenDb tests use the embedded RavenDB.TestDriver, so no docker services are required. Also fixes DiscoverTestMethods so inherited [Fact] methods on a compliance base class (e.g. LeadershipElectionCompliance) are attributed to the concrete derived class — previously leader-election projects discovered zero methods, silently running nothing. Includes the merged community fixes (JasperFx#2554, JasperFx#2555) which repair RavenDb scheduled-job locking and guard RavenDb durability recovery against orphaned listener URIs; both ship with regression tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Apr 23, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I ran into this running multiple Wolverine services against a single shared RavenDb envelope database. Every durability recovery pass was throwing a NullRef exception and spamming the logs every few seconds. I traced it to
RavenDbDurabilityAgent.tryRecoverIncomingMessages.Root cause
The method scans all distinct
ReceivedAtURIs in theIncomingMessagecollection and callsFindListenerCircuitfor each. When a URI belongs to a queue that this node doesn't service (because a different service owns it),FindListenerCircuitreturns null which causes an NRE trying to accesscircuit.Status:Note that I believe the same issue would occur in a single-service deployment if a listener URI was removed from config (or renamed), at that point any inbox documents that were still referencing the old URI would result in the same null reference exception.
Fix
Null-check the
circuitvariable and skip it