Skip to content
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

fix: ConsumerFilterRegistry unique actor name #1192

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

patriknw
Copy link
Member

@patriknw patriknw commented Sep 2, 2024

Noticed this occasionally:

Caused by: akka.grpc.GrpcServiceException: NOT_FOUND: Stream id [customer] is not available for consumption
	at akka.grpc.GrpcServiceException$.apply(GrpcServiceException.scala:40)
	at akka.grpc.internal.RequestBuilderImpl$.lift(RequestBuilderImpl.scala:481)
	at akka.grpc.internal.RequestBuilderImpl$$anonfun$richErrorStream$1.applyOrElse(RequestBuilderImpl.scala:473)
	at akka.grpc.internal.RequestBuilderImpl$$anonfun$richErrorStream$1.applyOrElse(RequestBuilderImpl.scala:472)
	at akka.stream.impl.fusing.RecoverWith$$anon$43.akka$stream$impl$fusing$RecoverWith$$anon$$onFailure(Ops.scala:2156)
	at akka.stream.impl.fusing.RecoverWith$$anon$43.onUpstreamFailure(Ops.scala:2151)
	... 21 more

09:00:06.737 ERROR akka.actor.typed.Behavior$ - Supervisor StopSupervisor saw failure: actor name [customer] is not unique!
akka.actor.InvalidActorNameException: actor name [customer] is not unique!
	at akka.actor.dungeon.ChildrenContainer$TerminatingChildrenContainer.reserve(ChildrenContainer.scala:200)
	at akka.actor.dungeon.Children.reserveChild(Children.scala:154)
	at akka.actor.dungeon.Children.reserveChild$(Children.scala:152)
	at akka.actor.ActorCell.reserveChild(ActorCell.scala:408)
	at akka.actor.dungeon.Children.makeChild(Children.scala:307)
	at akka.actor.dungeon.Children.actorOf(Children.scala:56)
	at akka.actor.dungeon.Children.actorOf$(Children.scala:55)
	at akka.actor.ActorCell.actorOf(ActorCell.scala:408)
	at akka.actor.typed.internal.adapter.ActorRefFactoryAdapter$.spawn(ActorRefFactoryAdapter.scala:55)
	at akka.actor.typed.internal.adapter.ActorContextAdapter.spawn(ActorContextAdapter.scala:73)
	at akka.projection.grpc.internal.ConsumerFilterRegistry.getOrCreateStore$1(ConsumerFilterRegistry.scala:64)
	at akka.projection.grpc.internal.ConsumerFilterRegistry.$anonfun$behavior$3(ConsumerFilterRegistry.scala:125)
	at akka.actor.typed.internal.BehaviorImpl$ReceiveMessageBehavior.receive(BehaviorImpl.scala:152)
	at akka.actor.typed.Behavior$.interpret(Behavior.scala:282)
	at akka.actor.typed.Behavior$.interpretMessage(Behavior.scala:238)
	at akka.actor.typed.internal.InterceptorImpl$$anon$2.apply(InterceptorImpl.scala:57)
	at akka.actor.typed.internal.SimpleSupervisor.aroundReceive(Supervision.scala:129)
	at akka.actor.typed.internal.InterceptorImpl.receive(InterceptorImpl.scala:85)
	at akka.actor.typed.Behavior$.interpret(Behavior.scala:282)
	at akka.actor.typed.Behavior$.interpretMessage(Behavior.scala:238)
	at akka.actor.typed.internal.adapter.ActorAdapter.handleMessage(ActorAdapter.scala:133)
	at akka.actor.typed.internal.adapter.ActorAdapter.aroundReceive(ActorAdapter.scala:109)

} catch {
case _: InvalidActorNameException =>
// There could be a race condition from SubscriberTerminated where the child is stopped,
// but not removed yet. The actor name isn't important, but could be useful for debugging.
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternative could be to watch the store remove it from the stores Map when Terminated is received. That would probably be more clean, but maybe increases the risk of sending a UpdateFilter message to a store that is about to terminate.

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Peter Vlugter <[email protected]>
@patriknw patriknw merged commit 15c944d into main Sep 12, 2024
22 checks passed
@patriknw patriknw deleted the wip-ConsumerFilterRegistry-patriknw branch September 12, 2024 09:15
@patriknw patriknw added this to the 1.5.5 milestone Sep 12, 2024
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.

3 participants