eclipse-ee4j / eclipse-ee4j/jersey

RequestEvent for RequestEventListener might lost request attributes for async flow

Open
#5,695 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Screenshot 2024-07-09 at 22 40 03

As you can see from above screen shot:

Thread A: request will be recycled ( attributes of request will be cleared)
Thread B: try to get request attribute from container request.

(Put breakpoints in 2 threads as above screenshot shows, let thread A go first to reproduce.)

And this is a simple spring boot application with parent: (could happen in older spring boot version)

```
org.springframework.boot
spring-boot-starter-parent
3.3.1
```

Not sure if it's a known issue or expected behavior, please have a look.

And from the RequestEvent contract, it supposed to be able to get a stable ContainerRequest rather than a fragile one.
I guess maybe we had a chance to clone/copy the request context somewhere instead of relying underlying tomcat request object.

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.