-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Jersey update from 3.1.3 to 3.1.4 slows down our external service res… #5749
Conversation
…eclipse-ee4j#5746 Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
b35fe36
to
cb3c4f2
Compare
Hello @jansupol, @jbescos, @senivam,
Please, take a look & run the reproducer code under: https://github.com/dtbaum/jersey-bug-report. |
Thanks for addressing the performance issue, @jbescos! However, allow me to elaborate on a few concerns I have with your approach:
|
@fwippe I welcome any good idea, the current state is not optimal. |
Why ignored? |
The synchronization explanation reference. |
@jansupol |
I knew there is no cleanup in the map, as long as the factory is alive. I was not concerned about it, because there should be anyway a pool of opened connections. Regarding the query parameters: Anyways, it can be easily solved in this way:
That prevents that 1+ connections are opened at the same time and it makes a cleanup. I will use host:port as a key instead of URL, because 1+ URLs to the same host:port could happen. |
That would only shift the issue to the next level: If the first REST request targets host1 and the second parallel request targets host2, the race condition will reoccur. The workaround replaces a performance issue with a more serious problem: In my opinion, we shouldn't improve this workaround, but rather eliminate it and find a clean solution. For many applications, security and the absence of race conditions are more important than a fixed performance issue.. |
Does it make an issue with different host in parallel?. If this is the case, then the fix I did will not help. I think in your example I saw that all the requests were happening in the same host:port. It is really strange that issue happens with different host:port, because those are different connections and different SSL handshakes. Were you able to reproduce the concurrent issue with my fix?. |
Yes. For simplicity, I reproduced it on the same host with different ports in parallel, but that should be enough to confirm my point.
Yes |
#5746 to 2.x branch