Skip to content

System initialization error when trying to send InitializeLogger message to the default logger #91

Description

@vonnagy

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions