It appears as though the DefaultLogger does not reply to InitializeLogger on line 200 of the LoggingBus.
import akka.pattern.ask
val response = try Await.result(actor ? InitializeLogger(this), timeout.duration) catch {
case _: TimeoutException ⇒
publish(Warning(logName, this.getClass, "Logger " + name + " did not respond within " + timeout + " to InitializeLogger(bus)"))
"[TIMEOUT]"
}
This issue is due to the actor system 'statsd' being created in the class AkkaIOStatsdCounterInterface. The issue only occurs when system agents are being monitored e.g. includeSystemAgents: true.
Here is the scenario:
- Make sure includeSystemAgents is turned on.
- When the system starts, Akka creates the default logger and sends an
InitializeLogger message to it.
- This triggers the around pointcut and then the
AkkaIOStatsdCounterInterface is created.
- When the "statsd" actor system is created, Akka tries to create another default loggger.
- The initial send of the
InitializeLogger message times out because of the time it takes to create the new actor system and the thread that is creating the AkkaIOStatsdCounterInterface.
As an experiment to prove this out, I first changed the creation of the 'statsd' system to lazy instantiation see #90. I then wrapped the logic in theCounterInterface methods in a Future. This disconnected the logic from the running thread which, in turn, allowed all messages to be received properly.
The test above is not necessarily a good long-term solution, but does point out the issue and possible ideas to its resolution.
It appears as though the DefaultLogger does not reply to InitializeLogger on line 200 of the LoggingBus.
This issue is due to the actor system 'statsd' being created in the class
AkkaIOStatsdCounterInterface. The issue only occurs when system agents are being monitored e.g. includeSystemAgents: true.Here is the scenario:
InitializeLoggermessage to it.AkkaIOStatsdCounterInterfaceis created.InitializeLoggermessage times out because of the time it takes to create the new actor system and the thread that is creating theAkkaIOStatsdCounterInterface.As an experiment to prove this out, I first changed the creation of the 'statsd' system to lazy instantiation see #90. I then wrapped the logic in the
CounterInterfacemethods in aFuture. This disconnected the logic from the running thread which, in turn, allowed all messages to be received properly.The test above is not necessarily a good long-term solution, but does point out the issue and possible ideas to its resolution.