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

Catch timeouts #11

Open
pwalczysko opened this issue Sep 15, 2023 · 1 comment · May be fixed by #12
Open

Catch timeouts #11

pwalczysko opened this issue Sep 15, 2023 · 1 comment · May be fixed by #12

Comments

@pwalczysko
Copy link
Member

pwalczysko commented Sep 15, 2023

The script atm is showing timeout when trying to ascertain the usage of user with complex data (not necessarily large, but, say, many images with attachments and KVPs on them).

Expected behaviour:
Let the script always finish, skip the user with complex data maybe using try... catch (= a basic feature request), but, possibly, report about such user at the end output (=a nice to have feature).

@will-moore

omero demo-cleanup --force --gigabytes 100
....
Finding disk usage of "user-with-complex-data" (#5828).
Traceback (most recent call last):
  File "/opt/omero/server/venv3/bin/omero", line 8, in <module>
    sys.exit(main())
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/main.py", line 126, in main
    rv = omero.cli.argv()
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1787, in argv
    cli.invoke(args[1:])
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1225, in invoke
    stop = self.onecmd(line, previous_args)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1302, in onecmd
    self.execute(line, previous_args)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/cli.py", line 1384, in execute
    args.func(args)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero_demo_cleanup/cli.py", line 53, in _wrapper
    return func(self, *args, **kwargs)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero_demo_cleanup/cli.py", line 133, in cleanup
    self.gateway, minimum_days=args.days, ignore_users=ignore
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero_demo_cleanup/library.py", line 322, in resource_usage
    rsp = submit(conn, DiskUsage2(targetObjects=user), DiskUsage2Response)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero_demo_cleanup/library.py", line 118, in submit
    cb = conn.c.submit(request, loops=500)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/clients.py", line 988, in submit
    closehandle=True)
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/clients.py", line 1007, in waitOnCmd
    callback.loop(loops, ms)  # Throw LockTimeout
  File "/opt/omero/server/venv3/lib64/python3.6/site-packages/omero/callbacks.py", line 265, in loop
    5000, int(waited))
omero.LockTimeout: exception ::omero::LockTimeout
{
    serverStackTrace = None
    serverExceptionClass = None
    message = Command unfinished after 250.0 seconds
    backOff = 5000
    seconds = 250
}
@joshmoore
Copy link
Member

https://github.com/ome/omero-demo-cleanup/blob/main/src/omero_demo_cleanup/library.py#L118 can either (1) be updated to use a longer value or (2) have arguments added (like --wait) to let the user configure this time.

@will-moore will-moore linked a pull request Sep 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants