-
1. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
jaikiran Oct 31, 2017 10:50 PM (in response to mph999)Can you attach a thread dump of the state you reach when the context is closed?
On a different note, WildFly 11 has been released WildFly 11 Final is now available! · WildFly , maybe you might want to upgrade to that.
-
2. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
mph999 Nov 1, 2017 11:24 AM (in response to jaikiran)Hi Jaikiran,
many thanks for replying. I've attached the thread dump after the context.close() call. I've been looking at the code, stepping through with the debugger on creation, and the code to close these workers is indeed added as JVM shutdown hooks.
I also tried Wildfly 11 this morning, with the ejb-remote/client quickstart app, without the dynamic classloading and the gui mods, but the principle is the same.
The Worker thread creation has changed a lot since Wildfly 10, but the shutdown of the worker threads is still only done at JVM shutdown, and the Context.close() method (of the defaultInitCtx) now looks completely empty.
If there is absolutely no option to manually terminate the ejb receivers on the client end, I will have to launch this particular component app in a separate VM
-
3. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
jaikiran Nov 2, 2017 1:19 AM (in response to mph999)1 of 1 people found this helpfulI actually misread your first post a bit. I thought you were using (JNDI) scoped EJB client contexts in WildFly 10. Now that I read it again, you in fact aren't using it. What that means is the JNDI context close that you are doing won't have an effect on the EJB client context which is scoped to the application. What you need to do is, close the (right) EJBClientContext when you are done with it. I say "right" EJBClientContext because I haven't seen your application code to know how many or who creates them. If it's just one EJBClientContext (which I guess is the case), then all you have to do is EJBClientContext.getCurrent().close(), when your application is done with its usage of EJBs.
-
4. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
mph999 Nov 2, 2017 6:01 AM (in response to jaikiran)Many thanks, Jaikiran,
I've tried that now with Wildfly 10, (needed to modify the pom to set the scope for wildfly-ejb-client-bom to compile) and it works!
(the config-based-ejb-client-endpoint and config-based-naming-client-endpoint threads stopped immediately on EjbClientContext.getCurrent.close(),
the ejb-client-context-tasks-1-threads (1-3) stopped after a couple of GC's. )
But...
it looks like EjbClientContext has lost the close() method in Wildfly 11, which would prevent us from upgrading at a later time.
Is there an equivalent in Wildfly 11? (or if not, any chance close() could be re-instated?)
Many thanks, again, this is a big step forward.
Best regards,
Matthew.
-
5. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
jaikiran Nov 2, 2017 6:15 AM (in response to mph999)Matthew Harrison wrote:
Many thanks, Jaikiran,
I've tried that now with Wildfly 10, (needed to modify the pom to set the scope for wildfly-ejb-client-bom to compile) and it works!
Glad to hear
Matthew Harrison wrote:
But...
it looks like EjbClientContext has lost the close() method in Wildfly 11, which would prevent us from upgrading at a later time.
Is there an equivalent in Wildfly 11? (or if not, any chance close() could be re-instated?)
WildFly 11 has undergone certain enhancements. One of them is to improve and simplify lookup, invocations and usage of EJBs from remote clients. I haven't fully caught up on the implementation details, so I don't have the complete picture of it yet. From what I read in one JIRA, the close() method isn't needed in the new scheme of things.
You might want to read these blogs which explain the new scheme of things, around remote EJB clients, in WildFly 11:
Getting started with EJBs and Elytron Part 1: Securing EJBs and invoking them from remote clients
Getting started with EJBs and Elytron Part 2: EJB invocations from remote servers
-
6. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
mph999 Nov 3, 2017 6:22 AM (in response to jaikiran)But...
it looks like EjbClientContext has lost the close() method in Wildfly 11, which would prevent us from upgrading at a later time.
Is there an equivalent in Wildfly 11? (or if not, any chance close() could be re-instated?)
WildFly 11 has undergone certain enhancements. One of them is to improve and simplify lookup, invocations and usage of EJBs from remote clients. I haven't fully caught up on the implementation details, so I don't have the complete picture of it yet. From what I read in one JIRA, the close() method isn't needed in the new scheme of things.
Many thanks for the links, I was able to reduce the size of the worker task pool using the new wildfly-config.xml, but they still live until VM shutdown.
So I've only slowed down the eventual exhaustion of threads (and memory, due to the URLClassLoader, and all its loaded classes, and any objects being pinned in place by the threads).
To be able to upgrade to Wildfly 11, I still need some means of closing the connections and worker threads ( or of triggering that) when the client app knows they will no longer be needed.
Best rgds,
Matthew.
-
7. Re: Remoting config-based-ejb-client-endpoint threads remain after context.close()
mph999 Nov 4, 2017 12:31 PM (in response to mph999)I asked here for Wildfly 11 [JBEAP-9401] EJBClientContext needs a close() method - JBoss Issue Tracker
and got an answer from David Lloyd.
So a big thank you, Jaikiran, I think I can go ahead with Wildfly 10, now that I also know that Wildfly 11 is also possible for us.