phnmnl / wft4galaxy

Testing module for Galaxy workflows
Other
10 stars 4 forks source link

Number of max HTTP(s) retries should be configurable #40

Closed pcm32 closed 7 years ago

pcm32 commented 7 years ago

I'm using wft4galaxy to stress test some instances, however, when sending too many test requests (20) I start to get some errors due to timeouts. It would be nice if this timeout/number of attempts to connect could be configurable through some flag, if at all possible. Error looks like this:

2017-10-10 17:54:18,500 [wft4galaxy] [ERROR]  HTTPSConnectionPool(host='publicdev.phenomenal-h2020.eu', port=443): Max retries exceeded with url: /api/histories/df ?key=
 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d1d1990>: Failed to establish a new connection: [Errno 60] Operation timed out',)), 0 attempts left
ERROR (284.785s)

======================================================================
ERROR [284.785s]: Workflow Test: 'fluxomics-stationary'
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/wft4galaxy-0.1-py2.7.egg/wft4galaxy/runner.py", line 545, in run_test
    outputs, output_history = workflow.run(datamap, history, params=params, wait=True, polling_interval=0.5)
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/bioblend-0.10.0-py2.7.egg/bioblend/galaxy/objects/wrappers.py", line 466, in run
    break_on_error=break_on_error)
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/bioblend-0.10.0-py2.7.egg/bioblend/galaxy/objects/galaxy_instance.py", line 95, in _wait_datasets
    datasets = poll(datasets)
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/bioblend-0.10.0-py2.7.egg/bioblend/galaxy/objects/galaxy_instance.py", line 85, in poll
    ds.refresh()
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/bioblend-0.10.0-py2.7.egg/bioblend/galaxy/objects/wrappers.py", line 577, in refresh
    ds_dict = gi_client.show_dataset(self.container.id, self.id)
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/bioblend-0.10.0-py2.7.egg/bioblend/galaxy/histories/__init__.py", line 168, in show_dataset
    return self._get(url=url)
  File "/Users/pmoreno/Development/wft4galaxy/.wft4gal/lib/python2.7/site-packages/bioblend-0.10.0-py2.7.egg/bioblend/galaxy/client.py", line 136, in _get
    status_code=r.status_code)
ConnectionError: HTTPSConnectionPool(host='publicdev.phenomenal-h2020.eu', port=443): Max retries exceeded with url: 
 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d1d1990>: Failed to establish a new connection: [Errno 60] Operation timed out',)), 0 attempts left:

Thanks!

ilveroluca commented 7 years ago

Pablo, try and see if the properties bioblend.galaxy.GalaxyInstance.max_get_attempts and bioblend.galaxy.GalaxyInstance.get_retry_delay have the effect you're looking for.

http://bioblend.readthedocs.io/en/latest/_modules/bioblend/galaxy.html?highlight=max_get_attempts

kikkomep commented 7 years ago

See PR #41