在我的Android应用中,我必须将文件上传到Google云端硬盘。直到昨天我上传了0个问题。它已经工作了一年多了。现在突然间我上传了很多失败的内容。大多数时候我得到“读取超时”但偶尔我会得到java.io.eofexception。一些上传只是延迟,对于一个小文件而不是正常的2秒可能是20秒,但大多数都是失败的。上传一个接一个地发生,每10次上传中有1或2个出现此问题。
我尝试使用最新的1.15.0-rc库,还有一些较旧的库,以及最新的google-api-services-drive-v2-rev82-1.14.2-beta.jar库。似乎没有任何帮助。
Google云端硬盘正在发生什么事情?我检查了状态页面,但没有显示任何问题。
我还创建了一个新的测试项目,它删除了我的所有代码,我使用新代码只是从mediastore连续上传10个文件作为测试,这个应用程序也遇到了同样的问题。
编辑:我在3个不同的网络上进行了测试,他们都产生了相同的行为。以下是例外情况的一个例子:
06-28 06:09:12.942: W/HttpTransport(5758): exception thrown while executing request
06-28 06:09:12.942: W/HttpTransport(5758): java.net.SocketTimeoutException: Read timed out
06-28 06:09:12.942: W/HttpTransport(5758): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
06-28 06:09:12.942: W/HttpTransport(5758): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:664)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.io.Streams.readSingleByte(Streams.java:41)
06-28 06:09:12.942: W/HttpTransport(5758): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:648)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.io.Streams.readAsciiLine(Streams.java:201)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:573)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:821)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:283)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:495)
06-28 06:09:12.942: W/HttpTransport(5758): at libcore.net.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:134)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.http.javanet.NetHttpResponse.<init>(NetHttpResponse.java:37)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:95)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.googleapis.media.MediaHttpUploader.executeCurrentRequest(MediaHttpUploader.java:456)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:362)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:420)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:345)
06-28 06:09:12.942: W/HttpTransport(5758): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:463)
答案 0 :(得分:1)
此问题在大约30小时后消失,没有任何代码更改。这肯定是Google云端硬盘的问题。