yandex / yandex-tank

Load and performance benchmark tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yandextank can't exit on closed connection to overload

gaainf opened this issue · comments

Looks like tank from master branch can't exit with Ctrl+C, if connection to overload was not established.

Reproduced on:
yandextank version: '1.11.1'
CentOS Linux: 7.3.1611

Actions:

  1. install yandextank from master branch
pip install --pre --upgrade http://api.github.com/repos/yandex/yandex-tank/tarball/master
  1. Deny connection to https://overload.yandex.net somehow (for example via iptables)
  2. start yandextank with config
phantom:
  address: 10.10.10.10:8000
  load_profile:
    load_type: rps
    schedule: line(1, 100, 10s) const(100, 10s)
  ammofile: file.ammo
  writelog: all

telegraf:
  enabled: false

uploader:
  token_file: token.txt
  enabled: true
  package: yandextank.plugins.DataUploader
  api_address: https://overload.yandex.net
  1. Try to stop yandextank via Ctrl+C, press at least 2 times

Result:

20:31:04 [WARNING] Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/yandextank/plugins/DataUploader/client.py", line 190, in __make_api_request
    response = self.__send_single_request(request, ids.next(), trace=trace)
  File "/usr/lib/python2.7/site-packages/yandextank/plugins/DataUploader/client.py", line 129, in __send_single_request
    resp = self.session.send(p, timeout=self.connection_timeout)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 504, in send
    raise ConnectTimeout(e, request=request)
ConnectTimeout: HTTPSConnectionPool(host='overload.yandex.net', port=443): Max retries exceeded with url: /api/job/create.json?api_token=db88995b21184dc1864ac98f0c310cef (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x372a5d0>, 'Connection to overload.yandex.net timed out. (connect timeout=30)'))

20:31:04 [WARNING] Network error, will retry in 10s...
^C
^C
^C
^C
20:31:44 [WARNING] Traceback (most recent call last):
...

Ctrl+Z and kill -9 helps only. On version 1.10.3 it is not reproducible.

fixed in #1.11.1