Drone-agents keep closing connections with 499 code

Greeting!

I’m using drone-server (v1.2.1) on a single machine with drone-agents on the different instances. The communication between drone-server and drone-agents is implemented via nginx proxy. Although there are no problems with agents main functionality, I see regular messages in nginx logs that drone-agents keeping connecting every minute and closing connection (499 code) after ~30s. For example, logs of one of the agent connecting:

11.22.33.44 domain.tld -/- [27/Jul/2019:13:42:00 +0300] "POST /rpc/v1/request HTTP/2.0" 499/-/11.22.33.44:4000 28.985/-/-/- 0 "-" "Go-http-client/2.0" "-" https/TLSv1.2/ECDHE-RSA-AES256-GCM-SHA384 "h2"
11.22.33.44 domain.tld -/- [27/Jul/2019:13:43:00 +0300] "POST /rpc/v1/request HTTP/2.0" 499/-/11.22.33.44:4000 28.992/-/-/- 0 "-" "Go-http-client/2.0" "-" https/TLSv1.2/ECDHE-RSA-AES256-GCM-SHA384 "h2"
11.22.33.44 domain.tld -/- [27/Jul/2019:13:44:00 +0300] "POST /rpc/v1/request HTTP/2.0" 499/-/11.22.33.44:4000 28.980/-/-/- 0 "-" "Go-http-client/2.0" "-" https/TLSv1.2/ECDHE-RSA-AES256-GCM-SHA384 "h2"
11.22.33.44 domain.tld -/- [27/Jul/2019:13:45:00 +0300] "POST /rpc/v1/request HTTP/2.0" 499/-/11.22.33.44:4000 28.986/-/-/- 0 "-" "Go-http-client/2.0" "-" https/TLSv1.2/ECDHE-RSA-AES256-GCM-SHA384 "h2"
11.22.33.44 domain.tld -/- [27/Jul/2019:13:46:00 +0300] "POST /rpc/v1/request HTTP/2.0" 499/-/11.22.33.44:4000 28.994/-/-/- 0 "-" "Go-http-client/2.0" "-" https/TLSv1.2/ECDHE-RSA-AES256-GCM-SHA384 "h2"

Is this a normal behaviour? I’m trying to identify the cause of the surrounding software abnormal resource consumption and these messages look weird. Thank you in advance!

Agents perform long polling to request workloads from the queue. After 30 seconds, if no workload is retrieved, the agent disconnects (to avoid annoying timeout issues with proxies, load balancers, etc) and then reconnects and retries. This is repeated until a workload is retrieved. Drone is therefore behaving as intended.

With that being said, the 499 does not come from Drone. That is specific to nginx.

1 Like

And this “timeout” is hardcoded, i.e. can’t be customized? :thinking:

1 Like