activemq icon indicating copy to clipboard operation
activemq copied to clipboard

[AMQ-9532] Convert DestinationMapNode from recursion to loops.

Open Nikita-Shupletsov opened this issue 1 year ago • 2 comments

Because destinations are parsed recursively, it's possible to trigger java.lang.StackOverflowError if a destination has too many nodes. the PR is converting the recursion to loops.

Ran DestinationMapTest.java to make sure the behavior of the class stays the same. There is no need for additional testing in my opinion, because the behavior is supposed to stay the same as it was before the change.

Nikita-Shupletsov avatar Jul 11 '24 22:07 Nikita-Shupletsov

@Nikita-Shupletsov how many is too-many nodes to trigger a stack overflow? What was the -Xss setting when the SO occurred?

mattrpav avatar Jul 16 '24 13:07 mattrpav

@Nikita-Shupletsov how many is too-many nodes to trigger a stack overflow? What was the -Xss setting when the SO occurred?

with -Xss256k it's around 1300

i've encountered the issue due to this: https://activemq.apache.org/components/classic/documentation/message-redelivery-and-dlq-handling#setting-expiration-on-messages-in-the-dlq there were DLQs for DlQs and so on

Nikita-Shupletsov avatar Jul 17 '24 02:07 Nikita-Shupletsov