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

Android在上傳大的日誌時,會timeout #505

Open
ALangHung opened this issue Feb 22, 2024 · 5 comments
Open

Android在上傳大的日誌時,會timeout #505

ALangHung opened this issue Feb 22, 2024 · 5 comments

Comments

@ALangHung
Copy link

ALangHung commented Feb 22, 2024

2024/02/22 11:30:28.326 31537 31575 Debug com.example.logan.LoganNative [upload] 開始發送日誌
2024/02/22 11:30:45.141 31537 31696 Warn System.err java.net.SocketTimeoutException: timeout
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:214)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:263)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:217)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:307)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:301)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:197)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:188)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:129)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:750)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:622)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.dianping.logan.SendLogDefaultRunnable.doPostRequest(SendLogDefaultRunnable.java:152)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.dianping.logan.SendLogDefaultRunnable.doSendFileByAction(SendLogDefaultRunnable.java:104)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.dianping.logan.SendLogDefaultRunnable.sendLog(SendLogDefaultRunnable.java:60)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.dianping.logan.SendLogRunnable.run(SendLogRunnable.java:59)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at java.lang.Thread.run(Thread.java:920)
2024/02/22 11:30:45.142 31537 31696 Warn System.err Caused by: java.net.SocketException: Socket closed
2024/02/22 11:30:45.142 31537 31696 Warn System.err at java.net.SocketInputStream.read(SocketInputStream.java:209)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at java.net.SocketInputStream.read(SocketInputStream.java:144)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.Okio$2.read(Okio.java:138)
2024/02/22 11:30:45.142 31537 31696 Warn System.err at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:213)
2024/02/22 11:30:45.142 31537 31696 Warn System.err ... 17 more
2024/02/22 11:30:45.142 31537 31696 Debug SendLogDefaultRunnable log send completed, http statusCode : -1

請問可以設定超時時間或是有其他處理方式嗎?

@Richard-Cao
Copy link
Member

多大的日志?这里面是个http请求

@ALangHung
Copy link
Author

ALangHung commented Feb 22, 2024

getAllFileInfo獲取map,打印日誌大小為9304976。

2024/02/22 14:59:19.131 18549 18586 Debug com.example.logan.LoganNative [printAllFileInfo] 2024-02-22 size: 9304976

可能跟日誌大小限制有關係嗎? 目前還沒有設定日誌大小限制。

@Richard-Cao
Copy link
Member

这个不大呀,我更怀疑是网络问题

@ALangHung
Copy link
Author

有可能是服務器端的問題嗎?

@Richard-Cao
Copy link
Member

有可能,建议你排查一下网络请求链路

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