[CONJ-566] Unable to LOAD DATA FROM S3 FILE with :aurora: setting Created: 2018-01-03  Updated: 2023-12-15  Resolved: 2023-12-15

Status: Closed
Project: MariaDB Connector/J
Component/s: aurora
Affects Version/s: 2.0.2, 2.2.0, 2.2.1
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Andrew Lundgren Assignee: Diego Dupin
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

When trying to load files from S3 using with the :aurora: option in the connect string we experience frequent failures resulting from read timeouts after about 20-40 seconds into a file load.

The problem is hit almost immediately if using multiple file loads at the same time. (i.e: 10 that would each take more than 20 seconds to load.)

With the 2.0.2 code these were thrown as: SQLNonTransientConnectionExceptions.

With the 2.2.0 and 2.2.1 code they are:
java.sql.SQLException: (conn=213) Communications link failure with primary host stage-b-hr-db-auroradbcluster-127qwjudpu2jb.cluster-ccucwzbnkosy.us-east-1.rds.amazonaws.com:3306. Read timed out
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:198)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110)
at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:235)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:332)
at org.mariadb.jdbc.MariaDbStatement.executeUpdate(MariaDbStatement.java:517)
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:410)
...
Caused by: java.sql.SQLException: Communications link failure with primary host stage-b-hr-db-auroradbcluster-127qwjudpu2jb.cluster-ccucwzbnkosy.us-east-1.rds.amazonaws.com:3306. Read timed out
Query is: LOAD DATA FROM S3 FILE ...
on HostAddress

{host='stage-b-hr-db-auroradbcluster-127qwjudpu2jb.cluster-ccucwzbnkosy.us-east-1.rds.amazonaws.com', port=3306}

,master=true. Driver has reconnect connection
at org.mariadb.jdbc.internal.failover.AbstractMastersListener.throwFailoverMessage(AbstractMastersListener.java:481)
at org.mariadb.jdbc.internal.failover.FailoverProxy.handleFailOver(FailoverProxy.java:309)
at org.mariadb.jdbc.internal.failover.FailoverProxy.executeInvocation(FailoverProxy.java:247)
at org.mariadb.jdbc.internal.failover.FailoverProxy.invoke(FailoverProxy.java:218)
at com.sun.proxy.$Proxy26.executeQuery(Unknown Source)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:326)
... 11 more
Caused by: java.net.SocketTimeoutException: Read timed out
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 sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at org.mariadb.jdbc.internal.io.input.StandardPacketInputStream.getPacketArray(StandardPacketInputStream.java:237)
at org.mariadb.jdbc.internal.io.input.StandardPacketInputStream.getPacket(StandardPacketInputStream.java:207)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1337)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1318)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:190)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mariadb.jdbc.internal.failover.AbstractMastersListener.invoke(AbstractMastersListener.java:379)
at org.mariadb.jdbc.internal.failover.FailoverProxy.executeInvocation(FailoverProxy.java:225)
... 14 more

I have not changed the validConnectionTimeout setting. When loading 10 files at once these errors happen right at 10 seconds.

Removing the :aurora: parameter and running with no failover/HA settings allows the files to load.



 Comments   
Comment by Diego Dupin [ 2018-01-04 ]

Aurora default configuration has a difference with other default: the option "socketTimeout" = network socket timeout (SO_TIMEOUT).
Using "aurora" failover configuration, this option is then set to 10s.

The problem you have is probably caused by that default configuration.
You can set that for those particular connection using Connection.setNetworkTimeout() or changing the option socketTimeout to 0 to disable this timeout.

Comment by Andrew Lundgren [ 2018-01-10 ]

Changing the timeout on the connection before and and after a file load worked.

Comment by Diego Dupin [ 2023-12-15 ]

closing since resolved by user

Generated at Thu Feb 08 03:16:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.