apache / apache/activemq

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

Open
#2,552 0 comments 0 reactions 1 assignee Claimed by @jbonofre View on GitHub
Dominant language
Java
Stars
2.5k
Forks
1.5k
Avg merge
10h 46m
Merged PRs (30d)
79

Description

## 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:

```java
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.