LNOpenMetrics / py-lnmetrics.api

Python implementation of the lnmetrics API to query the lnmetrics services
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

client timout #1

Open vincenzopalazzo opened 2 years ago

vincenzopalazzo commented 2 years ago

I receive a timeout when I query a big portion of metrics

Traceback (most recent call last):
  File "./analyzer.py", line 23, in <module>
    result = handler.handle(
  File "/home/vincent/Github/OpenLNMetrics/lnmetrics.result/analyzer/handlers/metric_one_chain.py", line 202, in handle
    next = handler.handle(**kwargs)
  File "/home/vincent/Github/OpenLNMetrics/lnmetrics.result/analyzer/handlers/metric_one_chain.py", line 37, in handle
    next = handler.handle(**kwargs)
  File "/home/vincent/Github/OpenLNMetrics/lnmetrics.result/analyzer/handlers/metric_one_chain.py", line 116, in handle
    metrics = self.client.get_metric_one(
  File "/home/vincent/.cache/pypoetry/virtualenvs/lnmetrics.analyzer-xcXbVzKZ-py3.8/lib/python3.8/site-packages/lnmetrics_api/lnmetrics_client.py", line 67, in get_metric_one
    resp = self.call(query, variables=variables)
  File "/home/vincent/.cache/pypoetry/virtualenvs/lnmetrics.analyzer-xcXbVzKZ-py3.8/lib/python3.8/site-packages/lnmetrics_api/lnmetrics_client.py", line 23, in call
    return self.client.execute(query, variable_values=variables)
  File "/home/vincent/.cache/pypoetry/virtualenvs/lnmetrics.analyzer-xcXbVzKZ-py3.8/lib/python3.8/site-packages/gql/client.py", line 355, in execute
    data = loop.run_until_complete(
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/vincent/.cache/pypoetry/virtualenvs/lnmetrics.analyzer-xcXbVzKZ-py3.8/lib/python3.8/site-packages/gql/client.py", line 252, in execute_async
    return await session.execute(
  File "/home/vincent/.cache/pypoetry/virtualenvs/lnmetrics.analyzer-xcXbVzKZ-py3.8/lib/python3.8/site-packages/gql/client.py", line 1143, in execute
    result = await self._execute(
  File "/home/vincent/.cache/pypoetry/virtualenvs/lnmetrics.analyzer-xcXbVzKZ-py3.8/lib/python3.8/site-packages/gql/client.py", line 1049, in _execute
    result = await asyncio.wait_for(
  File "/usr/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
(lnmetrics.analyzer-xcXbVzKZ-py3.8) ➜  lnmetrics.result git:(master) ✗ ./analyzer.py
Ram-lankada commented 1 year ago

From the context, I understood that it is querying a large amount of data. and it's an asynchronous operation with the API, which is taking more time required to respond - resulting in a "Timeout Error"

Why not increase the "Time out" time as it is querying large data.