Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting time should be limited #11

Closed
blokhin opened this issue Mar 15, 2023 · 5 comments
Closed

Waiting time should be limited #11

blokhin opened this issue Mar 15, 2023 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@blokhin
Copy link
Member

blokhin commented Mar 15, 2023

Currently, in case of some errors, this waits forever, and the synchronous client hangs on:

  ...
  File "/home/eb/metis-client/lib/python3.8/site-packages/asgiref/sync.py", line 218, in __call__
    current_executor.run_until_future(loop_future)
  File "/home/eb/metis-client/lib/python3.8/site-packages/asgiref/current_thread_executor.py", line 59, in run_until_future
    work_item = self._work_queue.get()
  File "/usr/lib/python3.8/queue.py", line 170, in get
    self.not_empty.wait()
  File "/usr/lib/python3.8/threading.py", line 302, in wait
    waiter.acquire()

Probably, some timer should be presented.

@blokhin blokhin added bug Something isn't working enhancement New feature or request labels Mar 15, 2023
@blokhin blokhin changed the title Waiting time should not be forever Waiting time should be limited Mar 15, 2023
@blokhin
Copy link
Member Author

blokhin commented May 3, 2023

to reproduce, e.g. stop BFF during the test run of client... it waits forever...

@blokhin
Copy link
Member Author

blokhin commented May 3, 2023

Wow, I have also discovered it might influence the GUI for that particular user 😳

metis-gui-bug

this happens only when our script hangs... As soon as we stop the script, GUI starts to work normally. Obviously, BFF works.

@blokhin
Copy link
Member Author

blokhin commented May 19, 2023

As noted by @knopki the asynchronous code supports the timeout straight away:

async with asyncio.timeout(5):
    await long_running_task()

However, a timeout argument is required for the synchronous code (may default to e.g. 5 seconds)

@blokhin
Copy link
Member Author

blokhin commented May 26, 2023

@knopki please, let’s prioritise this 🙏

@knopki
Copy link
Member

knopki commented Jun 5, 2023

Wow, I have also discovered it might influence the GUI for that particular user flushed
this happens only when our script hangs... As soon as we stop the script, GUI starts to work normally. Obviously, BFF works.

I can't confirm that.
If BFF dies because of some error, then yes, metis-client might influence the GUI.
But if the synchronous client is just waiting for results, the GUI works just fine.
Therefore, if there is a bug here, it's on the BFF side.

Timeouts as a client feature are implemented in #23

@blokhin blokhin closed this as completed Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants