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
Make loggers to not block ActorSystem creation #4424
Make loggers to not block ActorSystem creation #4424
Conversation
Made async loggers startup to be configurable, and disabled by default, because probably this leads to CI suite to block without threads available. Lots of Basically with new setting disabled it should be the same as earlier. CI should pass. If so, I will add few specs to verify that when some of the systems are running loggers in async way, this is fine. |
So, now we have logger creation task with async support. When When setting is disabled, it is performing async/await call with blocking |
/// Gets the logger start timeout. | ||
/// </summary> | ||
/// <value>The logger start timeout.</value> | ||
public bool LoggerAsyncStart { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try running it with this setting enabled to true everywhere? Looks like the test suite is running without it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - want to check if test suite will work well. Because it seems to me that it is blocking even without async version.
And before introducing this setting, the code was using "async" implementation by default (so I added this setting to be able to disable new behavior) - and test suite kind of stopped.
Probably I need to wait longer. Just checking out CI output and it does not change for some time
Ok, looks like it works (does not hang) when async run setting is disabled. I will enable it now. |
Ok, works well - only need to add api approvement |
Note: will need to disable new setting by default before merging this. |
And will need to add spec showing that without setting and with not-working logger ActorService is handing on Create call, but with setting enabled system is created without issues |
Finally found failing spec: LoggingBus_should_stop_all_loggers_on_termination
|
Fixed it. Now should pass - at least under Linux |
Failed specs: .NET Framework:
It might be racy. Will try to fix it. .NET Core (Windows):
.NET Core Linux:
Looks like all this specs are racy and are not related to the PR. But I will try making fixes for them, or at least to improve them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a question
@IgorFedchenko have a merge conflict here |
@Aaronontheweb Yeah, @Arkatufus did great job on skipping specs, some of them where already skipped in my code. |
Looks like a real test failure: Akka.DistributedData.Tests.ReplicatorSpecs.Bugfix_4198_PNCounterDictionary_Merge
System.Collections.Generic.KeyNotFoundException : The given key was not present in the dictionary. |
@Aaronontheweb Not sure about is it real - passing locally, and failing in this code: Within(TimeSpan.FromSeconds(5), () =>
{
AwaitAssert(() =>
{
foreach (var (probe, replicator, _) in probes)
{
replicator.Tell(Dsl.Get(_keyC, new ReadAll(_timeOut)), probe);
// Failure is here:
probe.ExpectMsg<GetSuccess>().Get(_keyC).Entries["x"].ShouldBe(new BigInteger(30.0d));
}
});
}); So seems like this is due to some increased delays. |
Looks like some tests were hanging in Akka.Streams because I tried to make them non-racy. Probably having some deadlocks there during threads starvation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Works well now. Good. |
Continuation of #4422 , trying to make loggers to start without blocking and not blow up the test suite