fix: keep entity verticle requests local when a local instance exists - #793
Merged
Conversation
Entity verticles register a consumer at the shared FQN address EntityVerticle[<FQN>] which forwards to the co-located DataVerticle[<name>] instance. In a clustered setup where the same entity verticle runs on multiple nodes, both addresses exist on every node, so requests could be round-robined to a remote instance. When that remote instance replies with an EntityWrapper for an entity type whose model is not buffered on the requesting node, the reply cannot be deserialized and the caller times out after 30s (surfacing as HTTP 500). Two changes in AbstractEntityVerticle: - The FQN consumer now forwards to ownAddress with setLocalOnly(true), so the inner hop always reaches the co-located instance and never round-robins across the cluster. - The FQN address is registered as a NeonBee local consumer on deployment (and unregistered on stop), so local-preferred requests resolve to the local instance instead of crossing nodes. Adds EntityVerticleLocalPreferredClusterTest (FakeClusterManager, CI-safe) which fails without the fix (30s reply timeout) and passes with it.
radrt
approved these changes
Aug 12, 2026
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.
Problem
Entity verticles register a consumer at the shared FQN address
EntityVerticle[<FQN>]which forwards to the co-locatedDataVerticle[<name>]instance. In a clustered setup where the same entity verticle runs on multiple nodes, both addresses are registered on every node, so a request could be round-robined to a remote instance.When the remote instance replies with an
EntityWrapperfor an entity type whose OData model is not buffered on the requesting node,EntityWrapperMessageCodec.encodeToWirefails, the reply is never delivered, and the caller times out after 30s — surfacing as an intermittent HTTP 500.This was observed in production on the
calendarservice:TimelineEventsintermittently 500'd because its nestedProductMapingentity request round-robined cross-node and the (unmodeled)EntityWrapperreply could not be serialized back.Fix
Two changes in
AbstractEntityVerticle:ownAddresswithsetLocalOnly(true). Its only job is to hand off to the co-located instance; it must never round-robin across the cluster.EntityVerticle[<FQN>]address is added to NeonBee's local-consumer registry (and removed onstop()), so local-preferred requests resolve to the local instance.Test
EntityVerticleLocalPreferredClusterTestuses the in-JVMFakeClusterManager(no external infra, CI-safe). Deploys a node-tagging entity verticle on both nodes and asserts requests with a local instance always resolve locally. Verified it fails without the fix (30s reply timeout onDataVerticle[...]) and passes with it.