Skip to content

Add timeout on FutureResponse to avoid hanging threads #1739

@jbonofre

Description

@jbonofre

This is related to https://issues.apache.org/jira/browse/AMQ-6763.

By default, FutureResponse.getResult() calls ArrayBlockingQueue.take() which blocks indefinitely.

When the broker becomes unreachable without the TCP connection being properly closed (network partition, half-open connection), threads calling ResponseCorrelator.request(Object) hang forever — as shown in the thread dump on the Jira.

I propose to expose a way for the user to define a timeout, something like -Dorg.apache.activemq.transport.ResponseCorrelator.maxResponseTimeout=30000. I wonder if we should not define this timeout by default.

Metadata

Metadata

Assignees

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