Avoid costly stack walk on every task start in AxonTimeLimitedTask#4635
Open
hjohn wants to merge 1 commit into
Open
Avoid costly stack walk on every task start in AxonTimeLimitedTask#4635hjohn wants to merge 1 commit into
hjohn wants to merge 1 commit into
Conversation
| int warningThreshold, | ||
| int warningInterval) { | ||
| int warningInterval, | ||
| Class<?> callerClass) { |
Contributor
There was a problem hiding this comment.
This is technically a breaking change as this class is not marked internal. Maybe we should overload this and use a sensible default
Contributor
Author
There was a problem hiding this comment.
We can, except no default will work to cut the stack trace short I think, so if you fail to specify a suitable value, you'll get the whole trace :)
Contributor
There was a problem hiding this comment.
I think that's fair. It's just to not break the contract, but I don't think it will actually happen
Thread.getStackTrace() was called on every start() to capture the caller class name for log trimming, even though that information is only used when a timeout fires. Callers already know their own class, so the name is now passed as a Class<?> constructor parameter and stored once. The stack frame comparison is also tightened from a substring search on toString() to an exact match on getClassName().
c92ba6c to
41f7e85
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Thread.getStackTrace() was called on every start() to capture the caller class name for log trimming, even though that information is only used when a timeout fires. Callers already know their own class, so the name is now passed as a Class<?> constructor parameter and stored once. The stack frame comparison is also tightened from a substring search on toString() to an exact match on getClassName().
Resolves #4637