[teiid-issues] [JBoss JIRA] (TEIID-5430) Closing Teiid JDBC connection is delayed 5 seconds

Hiroki Daicho (JIRA) issues at jboss.org
Mon Jul 23 22:48:00 EDT 2018


Hiroki Daicho created TEIID-5430:
------------------------------------

             Summary: Closing Teiid JDBC connection is delayed 5 seconds
                 Key: TEIID-5430
                 URL: https://issues.jboss.org/browse/TEIID-5430
             Project: Teiid
          Issue Type: Bug
          Components: JDBC Driver
    Affects Versions: 8.12.13.6_4
            Reporter: Hiroki Daicho
            Assignee: Steven Hawkins
         Attachments: JDBCClient.java

Teiid JDBC Driver waits 5 seconds during closing connection when the client can not reach teiid server.
If many connections are pooling by the client as a Datasource, it takes more time the closing all connections.
e.g. if the datasource has 50 connections, the close time would be 5 seconds * 50.

[1] is the stacktrace whie the connection is closing with the delay.
When closing connection, teiid JDBC waits server response by Future#get() with timeout of 5 seconds.
So, it would be waiting for the time if the socket doesn't receive any response.

[1] Stacktrace when the connection waits 5 seconds.
{code}
"main" #1 prio=5 os_prio=0 tid=0x00007f5b1c009000 nid=0x707b runnable [0x00007f5b238ac000]
   java.lang.Thread.State: RUNNABLE
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
	- locked <0x000000071c98cad0> (a org.teiid.core.util.AccessibleBufferedInputStream)
	at java.io.DataInputStream.readInt(DataInputStream.java:387)
	at org.teiid.netty.handler.codec.serialization.ObjectDecoderInputStream.readObjectOverride(ObjectDecoderInputStream.java:97)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:416)
	at org.teiid.net.socket.OioOjbectChannelFactory$OioObjectChannel.read(OioOjbectChannelFactory.java:117)
	at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:308)
	at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:411)
	at org.teiid.net.socket.SocketServerConnection.logoff(SocketServerConnection.java:331)
	at org.teiid.net.socket.SocketServerConnection.close(SocketServerConnection.java:306)
	- locked <0x000000071c51bb48> (a org.teiid.net.socket.SocketServerConnection)
	at org.teiid.jdbc.ConnectionImpl.close(ConnectionImpl.java:282)
	at ClientMain.invoke(ClientMain.java:83)
	at ClientMain.main(ClientMain.java:30)
{code}

[2]
https://github.com/teiid/teiid/blob/master/client/src/main/java/org/teiid/net/socket/SocketServerConnection.java#L319-L329
{code}
	private void logoff() {
		disconnect();
		try {
			//make a best effort to send the logoff
			Future<?> writeFuture = this.serverInstance.getService(ILogon.class).logoff();
			writeFuture.get(5000, TimeUnit.MILLISECONDS);
		} catch (Exception e) {
			//ignore
		}
		closeServerInstance();
	}
{code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the teiid-issues mailing list