yandex / yandex-tank

Load and performance benchmark tool
Other
2.46k stars 280 forks source link

yandextank can't exit on closed connection to overload #682

Closed gaainf closed 5 years ago

gaainf commented 6 years ago

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
  2. Deny connection to https://overload.yandex.net somehow (for example via iptables)
  3. 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

4. Try to stop yandextank via Ctrl+C, press at least 2 times

Result:
```bash
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.

fomars commented 6 years ago

Thank you for your report. Will fix in following release

вт, 20 нояб. 2018 г. в 22:19, gaainf notifications@github.com:

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
  2. Deny connection to https://overload.yandex.net somehow (for example via iptables)
  3. 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.0.3 it is not reproducible.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yandex/yandex-tank/issues/682, or mute the thread https://github.com/notifications/unsubscribe-auth/AGc3bj67H9qjHbM_fGzp3gtPQI4Vs02Tks5uxFW_gaJpZM4Yrw6y .

-- С уважением, Арсений Фомченко.

fomars commented 5 years ago

fixed in #1.11.1