[I] [BUG] 多个实例部署,偶尔个别实例文件句柄不能释放,导致上游调用请求网关超时返回504异常 [shenyu]</span></a></span> </h1> <p class="darkgray font13"> <span class="sender pipe"><a href="/search?l=notifications@shenyu.apache.org&q=from:%22via+GitHub%22" rel="nofollow"><span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">via GitHub</span></span></a></span> <span class="date"><a href="/search?l=notifications@shenyu.apache.org&q=date:20260303" rel="nofollow">Tue, 03 Mar 2026 05:51:12 -0800</a></span> </p> </div> <div itemprop="articleBody" class="msgBody"> <!--X-Body-of-Message--> <pre> yuli13244 opened a new issue, #6298: URL: <a rel="nofollow" href="https://github.com/apache/shenyu/issues/6298">https://github.com/apache/shenyu/issues/6298</a></pre><pre> ### Is there an existing issue for this? - [x] I have searched the existing issues ### Current Behavior shenyu代码版本:2.5.1 HttpClient配置: shenyu.httpclient.keepAlive = true shenyu.httpclient.pool.type = FIXED shenyu.httpclient.pool.name = proxy shenyu.httpclient.pool.acquireTimeout = 3000 shenyu.httpclient.pool.maxIdleTime = 10000 shenyu.httpclient.connectTimeout = 5000 shenyu.httpclient.maxInMemorySize = 10 bean定义 ```java @Bean public HttpClient httpClient(final HttpClientProperties properties, final ObjectProvider<LoopResources> provider) { // configure pool resources. HttpClientProperties.Pool pool = properties.getPool(); ConnectionProvider connectionProvider = buildConnectionProvider(pool); HttpClient httpClient = HttpClient.create(connectionProvider) .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, properties.getConnectTimeout()); HttpClientProperties.Proxy proxy = properties.getProxy(); if (StringUtils.isNotEmpty(proxy.getHost())) { httpClient = setHttpClientProxy(httpClient, proxy); } httpClient.doOnConnected(connection -> { connection.addHandlerLast(new IdleStateHandler(properties.getReaderIdleTime(), properties.getWriterIdleTime(), properties.getAllIdleTime(), TimeUnit.MILLISECONDS)); connection.addHandlerLast(new WriteTimeoutHandler(properties.getWriteTimeout(), TimeUnit.MILLISECONDS)); connection.addHandlerLast(new ReadTimeoutHandler(properties.getReadTimeout(), TimeUnit.MILLISECONDS)); }); final LoopResources loopResources = provider.getIfAvailable(); if (Objects.nonNull(loopResources)) { httpClient.runOn(loopResources); } HttpClientProperties.Ssl ssl = properties.getSsl(); if (StringUtils.isNotEmpty(ssl.getKeyStorePath()) || ArrayUtils.isNotEmpty(ssl.getTrustedX509CertificatesForTrustManager()) || ssl.isUseInsecureTrustManager()) { httpClient = httpClient.secure(sslContextSpec -> setSsl(sslContextSpec, ssl)); } if (properties.isWiretap()) { httpClient = httpClient.wiretap(true); } // set to false, fix java.io.IOException: Connection reset by peer // see <a rel="nofollow" href="https://github.com/reactor/reactor-netty/issues/388">https://github.com/reactor/reactor-netty/issues/388</a> return httpClient.keepAlive(properties.isKeepAlive()); } //使用默认的webclient客户端请求业务系统, @Configuration @ConditionalOnProperty(name = "shenyu.httpclient.strategy", havingValue = "webClient", matchIfMissing = true) static class WebClientConfiguration { /** * Web client plugin shenyu plugin. * * @param httpClient the http client * @return the shenyu plugin */ @Bean public ShenyuPlugin webClientPlugin( final HttpClientProperties properties, final ObjectProvider<HttpClient> httpClient) { WebClient webClient = WebClient.builder() // fix Exceeded limit on max bytes to buffer // detail see <a rel="nofollow" href="https://stackoverflow.com/questions/59326351/configure-spring-codec-max-in-memory-size-when-using-reactiveelasticsearchclient">https://stackoverflow.com/questions/59326351/configure-spring-codec-max-in-memory-size-when-using-reactiveelasticsearchclient</a> .exchangeStrategies(ExchangeStrategies.builder() .codecs(codecs -> codecs.defaultCodecs().maxInMemorySize(properties.getMaxInMemorySize() * 1024 * 1024)) .build()) .clientConnector(new ReactorClientHttpConnector(Objects.requireNonNull(httpClient.getIfAvailable()))) .build(); return new WebClientPlugin(webClient); } } ``` ### Expected Behavior _No response_ ### Steps To Reproduce _No response_ ### Environment ```markdown ShenYu version(s):2.5.1 ``` ### Debug logs 日志中没有报错信息 ### Anything else? _No response_ -- 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: notifications-unsubscr...@shenyu.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org </pre> </div> <div class="msgButtons margintopdouble"> <ul class="overflow"> <li class="msgButtonItems"><a class="button buttonleft " accesskey="p" href="msg34660.html">Previous message</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="c" href="index.html#34687">View by thread</a></li> <li class="msgButtonItems textaligncenter"><a class="button" accesskey="i" href="maillist.html#34687">View by date</a></li> <li class="msgButtonItems textalignright"><a class="button buttonright " accesskey="n" href="msg34688.html">Next message</a></li> </ul> </div> <a name="tslice"></a> <div class="tSliceList margintopdouble"> <ul class="icons monospace"> <li class="icons-email tSliceCur"><span class="subject">[I] [BUG] <title> 多个实例部署,偶尔个别实例文件句柄不能释放,导致上游调用请求网关超时返回504...</span> <span class="sender italic">via GitHub</span></li> <li><ul> <li class="icons-email"><span class="subject"><a href="msg34688.html">Re: [I] [BUG] <title> 多个实例部署,偶尔个别实例文件句柄不能释放,导致上游调用请求...</a></span> <span class="sender italic">via GitHub</span></li> </ul> </ul> </div> <div class="overflow msgActions margintopdouble"> <div class="msgReply" > <h2> Reply via email to </h2> <form method="POST" action="/mailto.php"> <input type="hidden" name="subject" value="[I] [BUG] <title> 多个实例部署,偶尔个别实例文件句柄不能释放,导致上游调用请求网关超时返回504异常 [shenyu]"> <input type="hidden" name="msgid" value="I_kwDOCGCHjs7va2B5@gitbox.apache.org"> <input type="hidden" name="relpath" value="notifications@shenyu.apache.org/msg34687.html"> <input type="submit" value=" via GitHub "> </form> </div> </div> </div> <div class="aside" role="complementary"> <div class="logo"> <a href="/"><img src="/logo.png" width=247 height=88 alt="The Mail Archive"></a> </div> <form class="overflow" action="/search" method="get"> <input type="hidden" name="l" value="notifications@shenyu.apache.org"> <label class="hidden" for="q">Search the site</label> <input class="submittext" type="text" id="q" name="q" placeholder="Search notifications"> <input class="submitbutton" name="submit" type="image" src="/submit.png" alt="Submit"> </form> <div class="nav margintop" id="nav" role="navigation"> <ul class="icons font16"> <li class="icons-home"><a href="/">The Mail Archive home</a></li> <li class="icons-list"><a href="/notifications@shenyu.apache.org/">notifications - all messages</a></li> <li class="icons-about"><a href="/notifications@shenyu.apache.org/info.html">notifications - about the list</a></li> <li class="icons-expand"><a href="/search?l=notifications@shenyu.apache.org&q=subject:%22%5C%5BI%5C%5D+%5C%5BBUG%5C%5D+%3Ctitle%3E+%E5%A4%9A%E4%B8%AA%E5%AE%9E%E4%BE%8B%E9%83%A8%E7%BD%B2%EF%BC%8C%E5%81%B6%E5%B0%94%E4%B8%AA%E5%88%AB%E5%AE%9E%E4%BE%8B%E6%96%87%E4%BB%B6%E5%8F%A5%E6%9F%84%E4%B8%8D%E8%83%BD%E9%87%8A%E6%94%BE%EF%BC%8C%E5%AF%BC%E8%87%B4%E4%B8%8A%E6%B8%B8%E8%B0%83%E7%94%A8%E8%AF%B7%E6%B1%82%E7%BD%91%E5%85%B3%E8%B6%85%E6%97%B6%E8%BF%94%E5%9B%9E504%E5%BC%82%E5%B8%B8+%5C%5Bshenyu%5C%5D%22&o=newest&f=1" title="e" id="e">Expand</a></li> <li class="icons-prev"><a href="msg34660.html" title="p">Previous message</a></li> <li class="icons-next"><a href="msg34688.html" title="n">Next message</a></li> </ul> </div> <div class="listlogo margintopdouble"> </div> <div class="margintopdouble"> </div> </div> </div> <div class="footer" role="contentinfo"> <ul> <li><a href="/">The Mail Archive home</a></li> <li><a href="/faq.html#newlist">Add your mailing list</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/faq.html#support">Support</a></li> <li><a href="/faq.html#privacy">Privacy</a></li> <li class="darkgray">I_kwDOCGCHjs7va2B5@gitbox.apache.org</li> </ul> </div> </body> </html> <script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'9e6c8b6b6cde983d',t:'MTc3NTI2NjE5Mw=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script>