Skip to content

fix: backtracking when fallback is enabled #166

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

Merged
merged 3 commits into from
Jul 11, 2025

Conversation

leviramsey
Copy link
Contributor

@leviramsey leviramsey commented Jul 10, 2025

The QueryDao NPEs when backtracking over fallback breadcrumb items, as it expects the EventSerId attribute to be set, when it's not.

Fix is to use a dummy zero serializer ID for breadcrumb items when backtracking. Since the only query for events which backtracks is the eventsBySlice query which only uses the serializer ID to:

  • deserialize if the payload is defined (viz. not when backtracking)
  • compare with the magic FilteredPayload serializer ID to mark the resulting envelope as filtered

any serializer ID would do; zero is chosen as it's Akka-reserved but otherwise unused but (for the absolute avoidance of confusion), this fix selects (on encountering the first fallback breadcrumb while backtracking) a serializer ID which is not bound to a serializer (since there are 4 billion legal serializer IDs (assuming negative IDs are allowed) and it's unlikely that a real system has even 4 thousand serializers (thus the chances are likely better than 999,999 in a million that any guess finds an unbound ID), it should be quick to find such an ID). Since the by-slice queries emit event envelopes and envelopes from backtracking leave the event empty, this dummy serializer ID doesn't get exposed to the user.

@leviramsey leviramsey requested a review from pvlugter July 10, 2025 19:32
@leviramsey leviramsey force-pushed the fallback-backtrack branch from 554007c to 0029d14 Compare July 10, 2025 19:39
Copy link
Member

@pvlugter pvlugter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pvlugter pvlugter merged commit 7c0acdf into akka:main Jul 11, 2025
9 checks passed
@leviramsey leviramsey deleted the fallback-backtrack branch July 11, 2025 02:37
@pvlugter pvlugter added this to the 2.0.8 milestone Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants