https://bz.apache.org/bugzilla/show_bug.cgi?id=63279

            Bug ID: 63279
           Summary: Tomcat 8.5 freezes in j_security_check with JDBCRealm
           Product: Tomcat 8
           Version: 8.5.34
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: liter...@centrum.cz
  Target Milestone: ----

It happens irregularly but almost every day a user submitting his credentials
must wait many minutes to finish the authentication. The browser is waiting for
a response. Restarting the tomcat will help for some time. Postgresql is
running fine and it has enough capacity to handle new connections. We fight
with it for the second week and we tried virtually everything.

*Environment:*

Tomcat 8.5.34
postgresql-42.2.5
1.8.0_162-b12 on Linux

*Configuration*

<Realm className="org.apache.catalina.realm.JDBCRealm" 
       connectionName="XXXXXX" connectionPassword="YYYYYYY" 
       connectionURL="jdbc:postgresql://10.100.123.10:5432/pmgviewer" 
       userRoleTable="userroles" userTable="tomcatusers"           
       roleNameCol="userrole" userCredCol="passwd" userNameCol="username" 
       driverName="org.postgresql.Driver" 
       maxActive="40" maxIdle="10" maxWait="10000" 
       validationQuery="SELECT 1" validationInterval="30000"
       testWhileIdle="true" testOnBorrow="true" testOnReturn="false"> 
       <CredentialHandler
className="org.apache.catalina.realm.MessageDigestCredentialHandler"
algorithm="SHA-256" /> 
</Realm> 

*Threads*

"https-jsse-nio-9443-exec-22" #149 daemon prio=5 os_prio=0
tid=0x00007f7e4802d000 nid=0x257c runnable [0x00007f7e29ea0000]
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 sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
- locked <0x00000000e5190b70> (a java.lang.Object)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
- locked <0x00000000e5191c38> (a sun.security.ssl.AppInputStream)
at
org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
at
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
at
org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
at org.postgresql.core.PGStream.receiveChar(PGStream.java:306)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
- locked <0x00000000e5192a40> (a org.postgresql.core.v3.QueryExecutorImpl)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)
at
org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106)
at org.apache.catalina.realm.JDBCRealm.getPassword(JDBCRealm.java:538)
- locked <0x00000000e00351f0> (a org.apache.catalina.realm.JDBCRealm)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:385)
- locked <0x00000000e00351f0> (a org.apache.catalina.realm.JDBCRealm)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:328)
- locked <0x00000000e00351f0> (a org.apache.catalina.realm.JDBCRealm)
at
org.apache.catalina.authenticator.FormAuthenticator.doAuthenticate(FormAuthenticator.java:264)


*Logs*

Mar 07, 2019 2:53:54 PM org.apache.catalina.realm.JDBCRealm getPassword
SEVERE: Exception performing authentication
org.postgresql.util.PSQLException: An I/O error occurred while sending to the
backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:335)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)

Caused by: java.net.SocketException: Connection timed out (Read failed)
at java.net.SocketInputStream.socketRead0(Native Method)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to