Mangopay / mangopay2-java-sdk

Java SDK for MANGOPAY
https://search.maven.org/artifact/com.mangopay/mangopay2-java-sdk
MIT License
25 stars 29 forks source link

com.mangopay.core.RestTool#doRequestList does not set any timeouts #296

Open raubjan opened 1 year ago

raubjan commented 1 year ago

while com.mangopay.core.RestTool#doRequest does set connection and readtimeout, doRequestList does not. we had the problem that one of our cronjobs to load open events was hanging while trying to read for the first time from the connection (retrieving the response code)

we run with version 2.20.0 but i also checked 2.27.0 but there is the same

see sample

java.base@11.0.16/java.net.SocketInputStream.socketRead0(Native Method)
java.base@11.0.16/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
java.base@11.0.16/java.net.SocketInputStream.read(SocketInputStream.java:168)
java.base@11.0.16/java.net.SocketInputStream.read(SocketInputStream.java:140)
java.base@11.0.16/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
java.base@11.0.16/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
java.base@11.0.16/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
java.base@11.0.16/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
java.base@11.0.16/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1506)
java.base@11.0.16/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1416)
java.base@11.0.16/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:456)
java.base@11.0.16/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:427)
java.base@11.0.16/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:572)
java.base@11.0.16/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:201)
java.base@11.0.16/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
java.base@11.0.16/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
java.base@11.0.16/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
java.base@11.0.16/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
com.mangopay.core.RestTool.doRequestList(RestTool.java:589)
com.mangopay.core.RestTool.requestList(RestTool.java:229)
com.mangopay.core.APIs.ApiBase.getList(ApiBase.java:363)
com.mangopay.core.APIs.ApiBase.getList(ApiBase.java:368)
com.mangopay.core.APIs.implementation.EventApiImpl.get(EventApiImpl.java:29)