Skip to content

StartCommand exits with no logged error after 10-minute default timeout when a slave broker legitimately waits for the lock under startAsync=true #2552

Description

@jbonofre

Problem

A broker started via ./activemq start, configured with startAsync=true and running as a slave, disappears after roughly 10 minutes with nothing logged.

Root cause

BrokerService.DEFAULT_START_TIMEOUT is 10 minutes. StartCommand calls broker.waitUntilStarted() with that timeout, then throws if it returns false:

if (!broker.waitUntilStarted()) {
    throw new Exception(broker.getStartException());
}

Before startAsync existed, this was never an issue, because start() itself blocked until the broker became master, so waitUntilStarted() returned almost immediately either way.

With startAsync=true, start() returns right away, and a slave broker can legitimately wait on the lock far longer than 10 minutes — that is expected behavior, not a failure. When the timeout is hit, waitUntilStarted() returns false with no start exception set, and StartCommand treats that as a startup failure and exits the process. Because there's no recorded exception, nothing is logged, which makes the process exit look silent and unexplained.

Environment

  • startAsync=true
  • Broker running as slave, waiting on the lock beyond the default 10-minute start timeout

Suggested fix

StartCommand should keep waiting as long as broker.getStartException() is null, and only throw/exit when there is an actual recorded start exception.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions