Skip to content

ActiveMQ's Transaction class creates two instances of FutureTask that are only ever used synchronously and could be re-used - #3087

Merged
mcculls merged 1 commit into
masterfrom
mcculls/ignoreInternalActiveMQTasks
Sep 23, 2021
Merged

mcculls merged 1 commit into
masterfrom
mcculls/ignoreInternalActiveMQTasks

Conversation

@mcculls

@mcculls mcculls commented Sep 22, 2021

Copy link
Copy Markdown
Contributor

Turning off async propagation for TransactionBroker.beginTransaction stops those FutureTask instances from being captured when the transaction is constructed and results in better checkpoints for ActiveMQ (we can't exclude these instances by type because their type is FutureTask, ie. they don't extend it.)

Before:

Test worker:                                    |-startSpan/1-|-suspend/1-|----------|-endSpan/1-|-startSpan/2-|-endSpan/2-|-startSpan/3-|-endSpan/3-|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|-----------|----------|-----------|----------|-----------|-startSpan/4-|-----------|-----------|----------|-suspend/4-|-----------|-----------|----------|-endSpan/4-|----------|-----------|-----------|-----------|----------|-----------|-----------|-startSpan/5-|-----------|-----------|-suspend/5-|----------|-endSpan/5-|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-----------|----------|-----------|-----------|----------|-----------|-----------|-startSpan/6-|-startSpan/7-|-startSpan/8-|-endSpan/8-|-endSpan/7-|-endSpan/6-|-startSpan/9-|-startSpan/10-|-startSpan/11-|-startSpan/12-|-endSpan/12-|-endSpan/11-|-endSpan/10-|-endSpan/9-|
ActiveMQ VMTransport: vm://embedded-broker#1-1: |-------------|-----------|-resume/1-|-----------|-------------|-----------|-------------|-----------|-suspend/1-|-suspend/1-|-resume/1-|-endTask/1-|-resume/1-|-suspend/1-|----------|-endTask/1-|-suspend/1-|-suspend/1-|----------|-endTask/1-|----------|-----------|-------------|-----------|-----------|----------|-----------|-----------|-----------|----------|-----------|----------|-----------|-----------|-----------|----------|-----------|-----------|-------------|-----------|-----------|-----------|----------|-----------|-----------|-resume/4-|-endTask/4-|-resume/4-|-suspend/4-|----------|-endTask/4-|-----------|----------|-----------|-----------|----------|-----------|-----------|----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ BrokerService[embedded-broker] Task-2: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|-----------|----------|-----------|----------|-----------|-resume/1-|-----------|-----------|-----------|----------|-----------|----------|-----------|-------------|-----------|-suspend/1-|----------|-----------|-----------|-endTask/1-|----------|-----------|----------|-----------|-----------|-----------|----------|-----------|-----------|-------------|-----------|-----------|-----------|----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|-resume/4-|-----------|-suspend/4-|----------|-endTask/4-|-----------|----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ VMTransport: vm://embedded-broker#0-2: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|-----------|-resume/1-|-----------|----------|-endTask/1-|-------------|-----------|-----------|----------|-----------|-----------|-----------|-resume/1-|-----------|----------|-suspend/1-|-----------|-endTask/1-|----------|-----------|-----------|-------------|-----------|-----------|-----------|----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-----------|-resume/4-|-----------|-suspend/4-|----------|-endTask/4-|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ VMTransport: vm://embedded-broker#1-2: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|-----------|----------|-----------|-resume/1-|-----------|-------------|-endTask/1-|-----------|----------|-----------|-----------|-----------|----------|-----------|-resume/4-|-----------|-----------|-----------|----------|-suspend/4-|-----------|-------------|-suspend/4-|-endTask/4-|-----------|-resume/5-|-----------|-endTask/5-|----------|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-----------|----------|-----------|-----------|----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ BrokerService[embedded-broker] Task-1: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|-----------|----------|-----------|----------|-----------|-------------|-----------|-----------|-resume/1-|-----------|-suspend/1-|-----------|----------|-----------|----------|-----------|-endTask/1-|-----------|----------|-----------|-----------|-------------|-----------|-----------|-----------|----------|-----------|-----------|----------|-----------|----------|-----------|-resume/4-|-----------|-suspend/4-|----------|-endTask/4-|-----------|----------|-----------|-----------|----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ Session Task-1:                        |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|-----------|----------|-----------|----------|-----------|-------------|-----------|-----------|----------|-----------|-----------|-----------|----------|-----------|----------|-----------|-----------|-----------|-resume/1-|-----------|-endTask/1-|-------------|-----------|-----------|-----------|----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-----------|----------|-----------|-----------|-resume/4-|-----------|-endTask/4-|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|

After:

Test worker:                                    |-startSpan/1-|-suspend/1-|----------|-endSpan/1-|-startSpan/2-|-endSpan/2-|-startSpan/3-|-endSpan/3-|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-startSpan/4-|-----------|-----------|-suspend/4-|-----------|----------|-endSpan/4-|----------|-----------|----------|-----------|-startSpan/5-|-----------|----------|-suspend/5-|-----------|-----------|----------|-endSpan/5-|-----------|-----------|-startSpan/6-|-startSpan/7-|-startSpan/8-|-endSpan/8-|-endSpan/7-|-endSpan/6-|-startSpan/9-|-startSpan/10-|-startSpan/11-|-startSpan/12-|-endSpan/12-|-endSpan/11-|-endSpan/10-|-endSpan/9-|
ActiveMQ VMTransport: vm://embedded-broker#1-1: |-------------|-----------|-resume/1-|-----------|-------------|-----------|-------------|-----------|-suspend/1-|----------|-suspend/1-|----------|-suspend/1-|-----------|----------|-endTask/1-|-------------|-----------|-----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-------------|-----------|----------|-----------|-----------|-----------|-resume/5-|-----------|-----------|-endTask/5-|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ BrokerService[embedded-broker] Task-2: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|-resume/1-|-----------|----------|-----------|-----------|----------|-----------|-------------|-----------|-suspend/1-|-----------|-endTask/1-|----------|-----------|----------|-----------|----------|-----------|-------------|-----------|----------|-----------|-----------|-----------|----------|-----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ VMTransport: vm://embedded-broker#0-1: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|----------|-----------|-resume/1-|-----------|-endTask/1-|----------|-----------|-------------|-----------|-----------|-----------|-----------|----------|-----------|----------|-----------|-resume/1-|-----------|-------------|-suspend/1-|----------|-----------|-----------|-endTask/1-|----------|-----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ VMTransport: vm://embedded-broker#1-2: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|----------|-----------|----------|-----------|-----------|-resume/1-|-----------|-------------|-endTask/1-|-----------|-----------|-----------|----------|-----------|-resume/4-|-----------|----------|-----------|-------------|-----------|----------|-----------|-endTask/4-|-----------|----------|-----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ BrokerService[embedded-broker] Task-1: |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-------------|-----------|-----------|-----------|-----------|-resume/1-|-----------|----------|-suspend/1-|----------|-endTask/1-|-------------|-----------|----------|-----------|-----------|-----------|----------|-----------|-----------|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|
ActiveMQ Session Task-1:                        |-------------|-----------|----------|-----------|-------------|-----------|-------------|-----------|-----------|----------|-----------|----------|-----------|-----------|----------|-----------|-------------|-----------|-----------|-----------|-----------|----------|-----------|----------|-----------|----------|-----------|-------------|-----------|-resume/1-|-----------|-----------|-----------|----------|-----------|-endTask/1-|-----------|-------------|-------------|-------------|-----------|-----------|-----------|-------------|--------------|--------------|--------------|------------|------------|------------|-----------|

The unusual sequences like |-suspend/1-|-suspend/1-|-resume/1-|-endTask/1-|-resume/1-|-suspend/1-| are now gone.

…at are only ever used synchronously and could be re-used.

Turning off async propagation for `TransactionBroker.beginTransaction` stops those `FutureTask` instances from being captured
when the transaction is constructed and results in better checkpoints for ActiveMQ (we can't exclude these instances by type
because their type is `FutureTask`, ie. they don't extend it.)
@mcculls mcculls added inst: others All other instrumentations inst: jms JMS instrumentation labels Sep 22, 2021
@mcculls
mcculls requested a review from a team as a code owner September 22, 2021 16:32
@mcculls
mcculls merged commit f9df75b into master Sep 23, 2021
@mcculls
mcculls deleted the mcculls/ignoreInternalActiveMQTasks branch September 23, 2021 08:54
@github-actions github-actions Bot added this to the 0.88.0 milestone Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: jms JMS instrumentation inst: others All other instrumentations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants