簡體   English   中英

播放框架“對等方重置連接”

[英]Play framework "Connection reset by peer"

我有一個 Scala Play(2.6.25) 應用程序。 根據此處的說明,我嘗試使用以下配置(application.conf)將讀取超時設置為 3 分鍾:

play {
  server {
    akka {
      bindTimeout = 180 seconds
      requestTimeout = infinite
    }
  }
}

play {
  server {
    http {
      idleTimeout = 180 seconds
    }
  }
}

但是客戶端的連接在大約 1 分 16 秒時被服務器斷開。

要求:

time curl --location --request POST 'http://localhost:9000/...' \
--header 'Content-Type: application/json' \
--header 'Cookie: JSESSIONID=78F3E25401A2631ABBE1006201AC1103' \
--max-time 180 \
--verbose \
--data-raw '{
   ...
}'

回復:

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9000 (#0)
> POST /... HTTP/1.1
> Host: localhost:9000
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Cookie: JSESSIONID=78F3E25401A2631ABBE1006201AC1103
> Content-Length: 1300
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< Date: Wed, 07 Oct 2020 18:24:32 GMT
* We are completely uploaded and fine
* Recv failure: Connection reset by peer
* stopped the pause stream!
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
curl --location --request POST  --header 'Content-Type: application/json'      0.01s user 0.01s system 0% cpu 1:16.11 total

過濾器被禁用( play.filters.enabled = [] )。

感謝有關我可能做錯的任何指示。

對於后代,將配置指定為系統屬性有助於解決問題。 像這樣:

-Dplay.server.http.idleTimeout=180s

來源: https : //github.com/playframework/playframework/issues/8286#issuecomment-372635585

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM