Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpURLConnection can't set connectTimeOut and readTimeOut #366

Open
feizhiyang opened this issue Dec 3, 2021 · 1 comment
Open

HttpURLConnection can't set connectTimeOut and readTimeOut #366

feizhiyang opened this issue Dec 3, 2021 · 1 comment

Comments

@feizhiyang
Copy link

The thread will holding where socket break off because HttpURLConnection can't set connectTimeOut and readTimeOut.
How should i solve the issue?
I suggest that the params of connectTime and readTime support to user-defined.

issue detail:
"thread-pool-2" #9901 prio=5 os_prio=0 cpu=516.49ms elapsed=434525.53s allocated=480M defined_classes=8 tid=0x00007fd4d416a000 nid=0x26bb runnable [0x00007fd466ef3000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(java.base@11.0.11/Native Method)
at java.net.SocketInputStream.socketRead(java.base@11.0.11/SocketInputStream.java:115)
at java.net.SocketInputStream.read(java.base@11.0.11/SocketInputStream.java:168)
at java.net.SocketInputStream.read(java.base@11.0.11/SocketInputStream.java:140)
at sun.security.ssl.SSLSocketInputRecord.read(java.base@11.0.11/SSLSocketInputRecord.java:478)
at sun.security.ssl.SSLSocketInputRecord.readHeader(java.base@11.0.11/SSLSocketInputRecord.java:472)
at sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(java.base@11.0.11/SSLSocketInputRecord.java:70)
at sun.security.ssl.SSLSocketImpl.readApplicationRecord(java.base@11.0.11/SSLSocketImpl.java:1364)
at sun.security.ssl.SSLSocketImpl$AppInputStream.read(java.base@11.0.11/SSLSocketImpl.java:973)
at java.io.BufferedInputStream.fill(java.base@11.0.11/BufferedInputStream.java:252)
at java.io.BufferedInputStream.read1(java.base@11.0.11/BufferedInputStream.java:292)
at java.io.BufferedInputStream.read(java.base@11.0.11/BufferedInputStream.java:351)
- locked <0x000000009b249738> (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(java.base@11.0.11/HttpClient.java:754)
at sun.net.www.http.HttpClient.parseHTTP(java.base@11.0.11/HttpClient.java:689)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(java.base@11.0.11/HttpURLConnection.java:1615)
- locked <0x000000009b283d00> (a sun.net.www.protocol.https.DelegateHttpsURLConnection)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(java.base@11.0.11/HttpURLConnection.java:1520)
- locked <0x000000009b283d00> (a sun.net.www.protocol.https.DelegateHttpsURLConnection)
at java.net.HttpURLConnection.getResponseCode(java.base@11.0.11/HttpURLConnection.java:527)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(java.base@11.0.11/HttpsURLConnectionImpl.java:334)
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:287)
at com.facebook.ads.sdk.APIRequest.access$100(APIRequest.java:52)
at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.sendPost(APIRequest.java:588)
at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.execute(APIRequest.java:520)
at com.facebook.ads.sdk.APIRequest.executeInternal(APIRequest.java:197)
at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdImage.execute(AdAccount.java:4225)
at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdImage.execute(AdAccount.java:4220)

Originally posted by @feizhiyang in #254 (comment)

@mengban0727
Copy link

same problem

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:170)
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:973)
- locked <0x00000000a6d492b8> (a java.lang.Object)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
- locked <0x00000000a6d492d0> (a sun.security.ssl.AppInputStream)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
- locked <0x00000000a7006398> (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1569)
- locked <0x00000000a68bb340> (a sun.net.www.protocol.https.DelegateHttpsURLConnection)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
- locked <0x00000000a68bb340> (a sun.net.www.protocol.https.DelegateHttpsURLConnection)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at com.facebook.ads.sdk.APIRequest.readResponse(APIRequest.java:289)
at com.facebook.ads.sdk.APIRequest.access$100(APIRequest.java:54)
at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.sendPost(APIRequest.java:592)
at com.facebook.ads.sdk.APIRequest$DefaultRequestExecutor.execute(APIRequest.java:524)
at com.facebook.ads.sdk.APIRequest.executeInternal(APIRequest.java:199)
at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdVideo.execute(AdAccount.java:11033)
at com.facebook.ads.sdk.AdAccount$APIRequestCreateAdVideo.execute(AdAccount.java:11028)
at com.dz.adserving.admin.fbdata.service.AdCreativeService.createVideo(AdCreativeService.java:52)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants