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.
Problem
A broker started via
./activemq start, configured withstartAsync=trueand running as a slave, disappears after roughly 10 minutes with nothing logged.Root cause
BrokerService.DEFAULT_START_TIMEOUTis 10 minutes.StartCommandcallsbroker.waitUntilStarted()with that timeout, then throws if it returns false:Before
startAsyncexisted, this was never an issue, becausestart()itself blocked until the broker became master, sowaitUntilStarted()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()returnsfalsewith no start exception set, andStartCommandtreats 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=trueSuggested fix
StartCommandshould keep waiting as long asbroker.getStartException()isnull, and only throw/exit when there is an actual recorded start exception.