liubao68 commented on issue #4835:
URL:
https://github.com/apache/servicecomb-java-chassis/issues/4835#issuecomment-2989603831
> > 能否针对“即使业务代码有正常的close调用也可能遇到类似的问题”提供下复现例子?
>
> 根据我们收到的反馈, 大概这样一个demo可以复现类似的问题:
>
> @PostMapping("/file")
> public String upload(@RequestPart(name = "file") Part file) throws
IOException, InterruptedException {
> try(final InputStream inputStream = file.getInputStream()) {
> TimeUnit.SECONDS.sleep(600); // 模拟一个长业务处理时延, 拖到客户端超时断连再继续业务处理流程
> final String x = process(inputStream);
> if (x != null) {
> return x;
> }
> }
> return "OK";
> }
如果是类似的场景发生的问题,可能需要业务排查下在关闭流之前,是否可能存在长期执行的任务或者未能执行完毕的任务,特别是业务有异步处理的情况。
修复方案可以在极端情况下关闭连接,但并未能修复潜在问题, 个人觉得比较重,而且存在一定风险。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]