1

I am facing an issue where simple redshift query hangs. I am using mule and deployed my code to cloudhub. Believe it has got to do with resultset size. When the result set size is very low, probably less than 50 rows, it works fine. However, anything beyond that appears to hang and I occasionally (after about 2hours of request), see this error in the logs. I am using the connection url as:

jdbc:postgresql://xyz?tcpKeepAlive=true&useCursors=true&user=abc&password=123

And by the way, everything works just fine in my local mule runtime.

********************************************************************************
Message               : [Amazon](500150) Error setting/closing connection: Connection reset by peer. (java.sql.SQLException). Message payload is of type: ParameterMap
Code                  : MULE_ERROR-29999
--------------------------------------------------------------------------------
Exception stack is:
1. [Amazon](500150) Error setting/closing connection: Connection reset by peer. (com.amazon.support.exceptions.GeneralException)
  com.amazon.jdbc.communications.channels.MessagesSocketChannel:-1 (null)
2. [Amazon](500150) Error setting/closing connection: Connection reset by peer. (java.sql.SQLException)
  com.amazon.jdbc.communications.channels.MessagesSocketChannel:-1 (null)
3. [Amazon](500150) Error setting/closing connection: Connection reset by peer. (java.sql.SQLException). Message payload is of type: ParameterMap (org.mule.api.MessagingException)
  org.mule.module.db.internal.processor.AbstractDbMessageProcessor:93 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
com.amazon.support.exceptions.GeneralException: [Amazon](500150) Error setting/closing connection: Connection reset by peer.
    at com.amazon.jdbc.communications.channels.MessagesSocketChannel.readMessages(Unknown Source)
    at com.amazon.jdbc.communications.channels.AbstractMessagesSocketChannel.read(Unknown Source)
    + 2 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
rst
  • 339
  • 5
  • 22
  • From where do you run the SQL and where is the Redshift? It might be EC2 to VPC difference in MTU settings. – Guy Apr 25 '15 at 13:52
  • I run it from CloudHub – rst Apr 25 '15 at 15:05
  • Check this documentation page for a possible solution: http://docs.aws.amazon.com/redshift/latest/mgmt/connecting-drop-issues.html – Guy Apr 25 '15 at 21:46
  • Once you login to Mulesoft Support site, lookup Knowledge Base Number 00001042 for the workaround. – Alan Leung Jul 16 '15 at 19:43

1 Answers1

0

As Guy mentioned in the comments, the issue seems to be Redshift using a fixed MTU.

See MuleSoft Knowledge Base article Mule application hangs on database select or insert when using Postgres on AWS Redshift for details.

aled
  • 21,330
  • 3
  • 27
  • 34