Skip to content

Clear recorded exception when request completes#16138

Merged
trask merged 4 commits intoopen-telemetry:mainfrom
laurit:clear-exception
Feb 23, 2026
Merged

Clear recorded exception when request completes#16138
trask merged 4 commits intoopen-telemetry:mainfrom
laurit:clear-exception

Conversation

@laurit
Copy link
Copy Markdown
Contributor

@laurit laurit commented Feb 11, 2026

Hopefully resolves #16129

@laurit laurit marked this pull request as ready for review February 11, 2026 15:53
@laurit laurit requested a review from a team as a code owner February 11, 2026 15:53
@Nullable
public static Throwable getException(Context context) {
AppServerBridge appServerBridge = context.get(AppServerBridge.CONTEXT_KEY);
public static Throwable getException(Context context, @Nullable Throwable error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this method can only be called once from now on. This kind of implicit rule is counterintuitive.

You might consider having the method throw an exception—for example, a checked exception like throw new MethodHasBeenCalledException()—or alternatively a RuntimeException, so that callers can become aware of this rule as early as possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There generally isn't a reason to call this method more than once. We rely on our tests to verify that this method is called when needed.

Copy link
Copy Markdown
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is NettyErrorHolder similar?

@trask trask enabled auto-merge (squash) February 23, 2026 02:34
@trask trask merged commit 7f4d6a0 into open-telemetry:main Feb 23, 2026
161 of 163 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible OOM When HttpUrlConnection is loaded before agent start

3 participants