[ 
https://issues.apache.org/jira/browse/TOMEE-2044?focusedWorklogId=1045086&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1045086
 ]

ASF GitHub Bot logged work on TOMEE-2044:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Oct/26 08:22
            Start Date: 01/Oct/26 08:22
    Worklog Time Spent: 10m 
      Work Description: rzo1 opened a new pull request, #3012:
URL: https://github.com/apache/tomee/pull/3012

   `EjbServer` creates its `KeepAliveServer` with `this`. The `ServicePool` 
wraps `EjbServer` from the outside, and `EjbServer` is not `Unwrappable`, so 
`KeepAliveServer.getQueue()` always returned `null`. As a result, the 
keep-alive timer never closed inactive sessions to drain a backed-up pool 
queue, as reported again in 
[TOMEE-2044](https://issues.apache.org/jira/browse/TOMEE-2044).
   
   The fix keeps the existing `unwrap` path. When that path finds nothing, it 
looks up the pool in `ServicePool.Registry`, where every pool registers itself 
on `start()`, and picks the one that wraps this exact service instance. 
Comparing by identity gives ejbd, ejbds and httpejbd each their own queue. That 
per-service queue is what the original singleton lookup got wrong.
   
   `KeepAliveServerPoolTest` covers two `EjbServer`s, one wrapped directly and 
one through a filter, each resolving to its own pool. It also covers the 
not-yet-started case and the `Unwrappable` path. The test fails without the fix 
(`findPool` returns `null`). `KeepAilveTest` still passes.




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1045086)
    Remaining Estimate: 0h
            Time Spent: 10m

> threadPool-queue (in ServicePool) from ejbd-Service is never processed 
> -----------------------------------------------------------------------
>
>                 Key: TOMEE-2044
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2044
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 1.7.4, 1.7.5, 1.7.6, 7.0.9, 7.0.10, 7.1.5, 9.0.0.RC1, 
> 8.0.13, 8.0.14, 8.0.15, 10.0.0-M1, 9.0.0, 9.1.0
>         Environment: FreeBSD 10.3-STABLE amd64 
> openjdk8-8.131.11
>            Reporter: Lars Herschke
>            Priority: Major
>             Fix For: 7.0.4
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If you have many requests to your ejbd-service the queue from the threadPool 
> in ServicePool.java is filled. This queue is never processed depending on 
> your server config. If you have only ejbd-service enabled and the services 
> admin, ejbds and httpejbd are disabled all is fine. If you have two or more 
> of these services enabled the issue could occur. The reason is the following.
> KeepAliveServer.java has the following line to get the queue.
> final ServicePool incoming = 
> SystemInstance.get().getComponent(ServicePool.class);
> SystemInstance.java hold components in a HahMap with the class type as key. 
> On server-startup the above named services are initalized in 
> ServiceManager.manage(...). This method instances new ServicePool for this 
> services. Each ServicePool-instance calls in his constructor
> SystemInstance.get().setComponent(ServicePool.class, this);.
> Every other call of setComponent replace the old entry in the components 
> HashMap. So KeepAliveServer gets always the queue of the last initalized 
> service.
> Workaround:
> Use only one of the four above named services
> or
> set threadsCore for your services at least as high, that the queue is never 
> used.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to