java_faye 2023-03-16 21:39 采纳率: 0%
浏览 82

aws s3 上传、下载出现连接超时

由于使用aws s3上传、下载文件未关闭IO流,引发的血案
上传文件出现异常:

Unable to execute HTTP request: Timeout waiting for connection from pool
com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1207)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1153)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:802)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:770)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:744)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:704)
        at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:686)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:550)
        at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:530)
        at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5062)
        at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5008)
        at com.amazonaws.services.s3.AmazonS3Client.access$300(AmazonS3Client.java:394)
        at com.amazonaws.services.s3.AmazonS3Client$PutObjectStrategy.invokeServiceCall(AmazonS3Client.java:5950)
        at com.amazonaws.services.s3.AmazonS3Client.uploadObject(AmazonS3Client.java:1812)
        at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1772)
        at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1710)
        at jrx.anyservice.user.service.service.impl.UserImageInfoServiceImpl.uploadImg(UserImageInfoServiceImpl.java:295)
        at jrx.anyservice.user.service.service.impl.UserImageInfoServiceImpl$$FastClassBySpringCGLIB$$2a48557.invoke(<generated>)
        at org.springframework.cglib.proxy

当时以为是网络不好,然后设置更长的超时时间,但是还是没有用
查看服务器出现大量的close_wait状态的TCP连接,而且不会自动断开,一直占用着资源。查看代码原来是上传、下载的时候没有关闭IO流。

  • 写回答

2条回答 默认 最新

  • threenewbee 2023-03-16 21:43
    关注

    检查下网络,是不是用了代理服务器?

    评论

报告相同问题?

问题事件

  • 创建了问题 3月16日

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境