对 Android 上使用 Jetty 引擎托管的 Ktor 的请求超时

问题描述 投票:0回答:0

我在带有 Jetty 引擎的 Android 设备上托管 ktor 服务器,并且请求不一致地需要 30 秒才能超时,并出现

java.util.concurrent.TimeoutException: Idle timeout expired
异常。如果发生这种情况,响应仍然会在 30 秒结束后正确发送给 Postman。有时可以通过重新启动设备来解决该问题,但这作为解决方案是不一致的,并且不能真正解决问题。如果问题没有发生,请求最多需要 500 毫秒才能响应。

这是

Selector sun.nio.ch. PollSelectorImpl@842116 waiting with 1 keys
线之后发生 30 秒差异的日志。

update org.eclipse.jetty.io. ChannelEndPoint$$ExternalSyntheticLambda0@8555f29
Key interests updated 0 -> 1 on SocketChannelEndPoint@1121ed6{1=/172.16.30.79:6
updates 0
Selector sun.nio.ch. PollSelectorImpl@842116 waiting with 1 keys
SocketChannelEndPoint@1121ed6{1=/172.16.30.79:8443,=/172.16.30.75:59459,OPEN,1
SocketChannelEndPoint@1121ed6{1=/172.16.30.79:8443,r=/172.16.30.75:59459,OPEN,1
SocketChannelEndPoint@1121ed6{=/172.16.30.79:8443,r=/172.16.30.75:59459,OPEN,1
onFail FillInterest@721d4b0{AC.ReadCB05f71d2d{HttpConnection@5f71d2d::SocketChé
java.util.concurrent. TimeoutException: Idle timeout expired: 30002/30000 ms
a org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:171)
atorg.eclipse.jetty.io.IdleTimeout.idleCheck(IdleTimeout.java:113)
atorg.eclipse.jetty.io.IdleTimeout.$r8$lambda$CXAKayJ04fsmNPZKEYcCFb0CwwE
atorg.eclipse.jetty.io.IdleTimeout$$ExternalSyntheticLambda0.run(Unknown‹
at java.util. concurrent. ScheduledThreadPoolExecutor$ScheduledFUtureTask.rur
close HttpParser{s=START,0 of - 1}
START - -> CLOSE
HttpConnection@5f71d2d::SocketChannelEndPoint@1121ed6{1=/172.16.30.79:8443,г=/1
java.util.concurrent. TimeoutException: Idle timeout expired: 30002/30000 ms
a org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:171)
a org.eclipse.jetty.io. IdleTimeout.idleCheck(IdleTimeout.java:113)
atorg.eclipse.jetty.io.IdleTimeout.$r8$lambda$CXAKayJ04fsmNPZKEYCCFbOCwwE```
android jetty ktor
© www.soinside.com 2019 - 2024. All rights reserved.