[keycloak-user] JDBC Connection is closed early for Infinispan
Marek Posolda
mposolda at redhat.com
Mon Jul 11 03:40:18 EDT 2016
Hmm... then maybe it's the Wildfly issue in Jgroups subsystem.
The startup lifecycle usually works in a way, that if componentA is
dependent on componentB, then startup should first ensure that
componentB is started and then componentA is started afterwards. The
shutdown works in an opposite way, hence componentA must be first
shutdown and then componentB afterwards.
I suppose that JGroups subsystem should be clever enough that if it sees
the property "datasource_jndi_name", it should internally declare itself
to be dependent on "java:/MySQLDS" datasource. This should ensure that
during shutdown is JGroups channel shutdown first and then the
datasource is shutdown afterwards.
Could you ask on Wildfly forums for this?
Marek
On 11/07/16 09:11, Sarp Kaya wrote:
> Hi Marek,
>
> The configuration for JDBC_PING is already like this:
>
> <protocol type="JDBC_PING"> <property name="datasource_jndi_name">java:/MySQLDS</property> <property name="clear_table_on_view_change">true</property> </protocol>
>
> Do you mean something else or is this enough to “declare dependency”
> on MySQLDS?
>
> Kind Regards,
> Sarp Kaya
>
> From: Marek Posolda <mposolda at redhat.com <mailto:mposolda at redhat.com>>
> Date: Monday, July 11, 2016 at 4:54 PM
> To: Abdullah Sarp Kaya <akaya at expedia.com <mailto:akaya at expedia.com>>,
> "keycloak-user at lists.jboss.org <mailto:keycloak-user at lists.jboss.org>"
> <keycloak-user at lists.jboss.org <mailto:keycloak-user at lists.jboss.org>>
> Subject: Re: [keycloak-user] JDBC Connection is closed early for
> Infinispan
>
> Not sure if this is Wildfly issue or Keycloak issue. Maybe it can be
> handled somehow in our subsystem, so you will be able to declare that
> infinispan CacheManager (or JGroups Channel) is dependent on
> datasource "java:/MySQLDS" , which should then ensure that
> infinispan/jgroups will be shoutdown first and then the MySQLDS
> datasource afterwards.
>
> Maybe we can handle our subsystem should be more "flexible" and
> support somehow to easily declare dependencies on additional
> components (maybe it supports it already, I don't know...)
>
> Maybe you can create JIRA and investigate this deeper. I suggest you
> investigate by yourself as we probably won't have time to look at it.
> The JGroups channel with JDBC_PING is probably not very big priority
> for us...
>
> Marek
>
> On 11/07/16 02:59, Sarp Kaya wrote:
>> Hello,
>>
>> For the caching if we are using infinispan with JDBC_PING then JDBC
>> connection is closed before infinispan stops its caching related
>> stuff. This causes an exception to be thrown and therefore it does
>> not really shut infinispan gracefully.
>>
>> Logs:
>> 2016-07-11 00:53:48,330 INFO [org.jboss.as.server] (Thread-2)
>> WFLYSRV0220: Server shutdown has been requested.
>> 2016-07-11 00:53:48,385 INFO
>> [org.jboss.as.connector.subsystems.datasources] (MSC service thread
>> 1-2) WFLYJCA0010: Unbound data source [java:/MySQLDS]
>> 2016-07-11 00:53:48,394 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-2) ISPN000080: Disconnecting JGroups channel web
>> 2016-07-11 00:53:48,396 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-1) ISPN000080: Disconnecting JGroups channel server
>> 2016-07-11 00:53:48,395 INFO [org.wildfly.extension.undertow]
>> (ServerService Thread Pool -- 60) WFLYUT0022: Unregistered web
>> context: /auth
>> 2016-07-11 00:53:48,397 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-2) ISPN000082: Stopping the RpcDispatcher for
>> channel web
>> 2016-07-11 00:53:48,398 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-1) ISPN000082: Stopping the RpcDispatcher for
>> channel server
>> 2016-07-11 00:53:48,403 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-1) ISPN000080: Disconnecting JGroups channel hibernate
>> 2016-07-11 00:53:48,408 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-1) ISPN000082: Stopping the RpcDispatcher for
>> channel hibernate
>> 2016-07-11 00:53:48,407 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-2) ISPN000080: Disconnecting JGroups channel ejb
>> 2016-07-11 00:53:48,411 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-2) ISPN000082: Stopping the RpcDispatcher for
>> channel ejb
>> 2016-07-11 00:53:48,414 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-2) WFLYUT0008: Undertow HTTPS listener https suspending
>> 2016-07-11 00:53:48,416 WARN
>> [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool]
>> (ServerService Thread Pool -- 59) IJ000615: Destroying active
>> connection in pool: MySQLDS
>> (org.jboss.jca.adapters.jdbc.local.LocalManagedConnection at 57e067d0)
>> 2016-07-11 00:53:48,423 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-2) WFLYUT0007: Undertow HTTPS listener https
>> stopped, was bound to 0.0.0.0:8443
>> 2016-07-11 00:53:48,429 INFO [org.jboss.as.connector.deployers.jdbc]
>> (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with
>> driver-name = mysql
>> 2016-07-11 00:53:48,434 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-1) WFLYUT0019: Host default-host stopping
>> 2016-07-11 00:53:48,448 INFO
>> [org.jboss.as.connector.subsystems.datasources] (MSC service thread
>> 1-1) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
>> 2016-07-11 00:53:48,467 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 59) WFLYCLINF0003: Stopped sessions
>> cache from keycloak container
>> 2016-07-11 00:53:48,472 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 60) WFLYCLINF0003: Stopped realms cache
>> from keycloak container
>> 2016-07-11 00:53:48,475 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 60) WFLYCLINF0003: Stopped
>> loginFailures cache from keycloak container
>> 2016-07-11 00:53:48,477 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 59) WFLYCLINF0003: Stopped
>> offlineSessions cache from keycloak container
>> 2016-07-11 00:53:48,487 INFO [org.jboss.as.connector.deployers.jdbc]
>> (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with
>> driver-name = h2
>> 2016-07-11 00:53:48,489 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 63) WFLYCLINF0003: Stopped users cache
>> from keycloak container
>> 2016-07-11 00:53:48,492 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-2) WFLYUT0008: Undertow AJP listener ajp suspending
>> 2016-07-11 00:53:48,496 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 62) WFLYCLINF0003: Stopped
>> realmVersions cache from keycloak container
>> 2016-07-11 00:53:48,497 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-2) WFLYUT0007: Undertow AJP listener ajp stopped,
>> was bound to 0.0.0.0:8009
>> 2016-07-11 00:53:48,500 INFO [org.jboss.as.clustering.infinispan]
>> (ServerService Thread Pool -- 64) WFLYCLINF0003: Stopped work cache
>> from keycloak container
>> 2016-07-11 00:53:48,499 INFO [org.jboss.modcluster] (ServerService
>> Thread Pool -- 65) MODCLUSTER000002: Initiating mod_cluster shutdown
>> 2016-07-11 00:53:48,506 INFO [org.jboss.as.server.deployment] (MSC
>> service thread 1-2) WFLYSRV0028: Stopped deployment
>> keycloak-server.war (runtime-name: keycloak-server.war) in 138ms
>> 2016-07-11 00:53:48,499 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-1) WFLYUT0008: Undertow HTTP listener default suspending
>> 2016-07-11 00:53:48,508 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-1) WFLYUT0007: Undertow HTTP listener default
>> stopped, was bound to 0.0.0.0:8080
>> 2016-07-11 00:53:48,516 INFO [org.jboss.as.clustering.infinispan]
>> (MSC service thread 1-2) WFLYCLINF0003: Stopped authorization cache
>> from keycloak container
>> 2016-07-11 00:53:48,517 INFO [org.wildfly.extension.undertow] (MSC
>> service thread 1-1) WFLYUT0004: Undertow 1.3.15.Final stopping
>> 2016-07-11 00:53:48,542 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-2) ISPN000080: Disconnecting JGroups channel keycloak
>> 2016-07-11 00:53:48,543 INFO
>> [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC
>> service thread 1-2) ISPN000082: Stopping the RpcDispatcher for
>> channel keycloak
>> 2016-07-11 00:53:48,553 ERROR [org.jgroups.protocols.JDBC_PING] (MSC
>> service thread 1-1) Could not open connection to database:
>> java.sql.SQLException: javax.resource.ResourceException: IJ000470:
>> You are trying to use a connection factory that has been shut down:
>> java:/MySQLDS
>> at
>> org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:146)
>> at
>> org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:66)
>> at
>> org.jgroups.protocols.JDBC_PING.getConnection(JDBC_PING.java:348)
>> at org.jgroups.protocols.JDBC_PING.delete(JDBC_PING.java:379)
>> at org.jgroups.protocols.JDBC_PING.deleteSelf(JDBC_PING.java:395)
>> at org.jgroups.protocols.JDBC_PING.stop(JDBC_PING.java:144)
>> at
>> org.jgroups.stack.ProtocolStack.stopStack(ProtocolStack.java:1015)
>> at org.jgroups.JChannel.stopStack(JChannel.java:1002)
>> at org.jgroups.JChannel.disconnect(JChannel.java:373)
>> at
>> org.wildfly.clustering.jgroups.spi.service.ChannelConnectorBuilder.stop(ChannelConnectorBuilder.java:103)
>> at
>> org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:2056)
>> at
>> org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:2017)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> at java.lang.Thread.run(Thread.java:745)
>> Caused by: javax.resource.ResourceException: IJ000470: You are trying
>> to use a connection factory that has been shut down: java:/MySQLDS
>> at
>> org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:735)
>> at
>> org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138)
>> ... 14 more
>>
>> 2016-07-11 00:53:48,559 ERROR [org.jgroups.protocols.JDBC_PING] (MSC
>> service thread 1-1) Failed to delete PingData in database
>> 2016-07-11 00:53:51,576 INFO [org.jboss.as] (MSC service thread 1-1)
>> WFLYSRV0050: Keycloak 2.0.0.Final (WildFly Core 2.0.10.Final) stopped
>> in 3208ms
>>
>>
>> Kind Regards,
>> Sarp Kaya
>>
>>
>> _______________________________________________
>> keycloak-user mailing list
>> keycloak-user at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/keycloak-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160711/54446f4f/attachment-0001.html
More information about the keycloak-user
mailing list