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

Exceeding max-concurrent-recoveries triggers circuit breaker #6106

Open
lucavice opened this issue Sep 21, 2022 · 2 comments
Open

Exceeding max-concurrent-recoveries triggers circuit breaker #6106

lucavice opened this issue Sep 21, 2022 · 2 comments

Comments

@lucavice
Copy link
Contributor

Version Information
Version of Akka.NET? 1.4.40
Which Akka.NET Modules? Akka.Cluster.Sharding 1.4.40, Akka.Persistence.SqlServer 1.4.35

Describe the bug
In certain situations, exceedeing temporarily the max-concurrenct-recoveries parameter triggers a circuit breaker that prevents Akka Persistence to persist any further events for the duration of the circuit breaker.

See sequence of logged events here:
image

I have been unable to reproduce reliably this problem, as it seems to happen fairly randomly on our production instance (a few times per day).
Setting locally a max-concurrenct-recoveries equal to 1 and force recover of multiple actor at once does not seem to create the issue, so it must be triggered by a combination of factors.

We can't find the root of the error that triggers the circuit breaker. There is no information in the logged OpenCircuitException, and that's the only error that appears in the log (hundreds of times for the duration of the open circuit breaker).

To Reproduce
I don't have reliable steps to trigger the problem.
I would appreciate hints on what I could try to understand better the underlying problem and come up with a strategy to reproduce reliably. It may be possible that this is entirely caused by some bad programming on my side, but I'm a bit lost in what to look for.

Environment
Windows on .NET 6

@Aaronontheweb
Copy link
Member

Looks like @ismaelhamed has a fix for this targeting the v1.5 branch - we'll see if we can also backport that to a future v1.4 release as well. Going to review Ismael's work along with @Arkatufus right now.

@Aaronontheweb Aaronontheweb added this to the 1.5.0 milestone Sep 23, 2022
@lucavice
Copy link
Contributor Author

@ismaelhamed @Aaronontheweb I was able to retrieve some errors today which include a more detailed stack trace.

I'm posting it here, in case it helps identifying if it's actually related to #6109

Akka.Pattern.OpenCircuitException: Circuit Breaker is open; calls are failing fast
 ---> System.ArgumentException: The tasks argument contains no tasks. (Parameter 'tasks')
   at System.Threading.Tasks.TaskFactory.CheckMultiContinuationTasksAndCopy(Task[] tasks)
   at System.Threading.Tasks.TaskFactory`1.ContinueWhenAllImpl(Task[] tasks, Func`2 continuationFunction, Action`1 continuationAction, TaskContinuationOptions continuationOptions, CancellationToken cancellationToken, TaskScheduler scheduler)
   at Akka.Persistence.Sql.Common.Journal.SqlJournal.WriteMessagesAsync(IEnumerable`1 messages)
   at Akka.Util.Internal.AtomicState.CallThrough[T](Func`1 task)
   at Akka.Util.Internal.AtomicState.CallThrough[T](Func`1 task)
   --- End of inner exception stack trace ---

@Aaronontheweb Aaronontheweb modified the milestones: 1.5.21, 1.5.22, 1.5.23 May 28, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.23, 1.5.24, 1.5.25 Jun 6, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.25, 1.5.26 Jun 14, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.26, 1.5.27 Jun 27, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.27, 1.5.28 Jul 25, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.28, 1.5.29 Sep 4, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.29, 1.5.30, 1.5.31 Oct 1, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.31, 1.5.32 Nov 14, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.32, 1.5.33 Dec 4, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.33, 1.5.34 Dec 24, 2024
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.34, 1.5.35 Jan 7, 2025
@Aaronontheweb Aaronontheweb modified the milestones: 1.5.35, 1.5.36 Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants