EventStore / EventStore.JVM

Event Store JVM Client
https://geteventstore.com
BSD 3-Clause "New" or "Revised" License
223 stars 40 forks source link

Exception instead of actor stop on cluster failure? #85

Open reinierl opened 7 years ago

reinierl commented 7 years ago

In https://github.com/EventStore/EventStore.JVM/blob/8708a3f14f82dfdfef9077bec7c8644aa0711640/src/main/scala/eventstore/tcp/ConnectionActor.scala#L143-L146, the ConnectionActor is stopped when it definitively fails to connect to a cluster after a configurable number of tries. This forces us to use DeathWatch to respond to this, and we're not entirely sure of why the actor died.

Is there a reason that the actor stops itself, rather than throwing a Throwable that could be handled by the Akka supervision system?

t3hnar commented 7 years ago

good question. On one hand client users should not bother with supervision, as basically client already doing a lot for this internally. On other hand it does not align with akka ideology.

But in case event store connection is a system critical component, it is better to throw an exception. So let's improve part.

michielboekhoff commented 7 years ago

Is this being picked up? Otherwise I could always take a peek - should be a quick fix.

t3hnar commented 7 years ago

please go ahead and fire a pull request :)