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

admin.py: handle errors in getdirsize #135

Merged
merged 2 commits into from Dec 3, 2019
Merged

Conversation

joshmoore
Copy link
Member

see:

Both failed with:

01:24:20 OMERO data dir:'/home/omero/workspace/OMERO-test-integration/data' Exists? True	Is writable? True
01:24:21 Traceback (most recent call last):
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/bin/omero", line 131, in <module>
01:24:21     rv = omero.cli.argv()
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/cli.py", line 1756, in argv
01:24:21     cli.invoke(args[1:])
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/cli.py", line 1187, in invoke
01:24:21     stop = self.onecmd(line, previous_args)
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/cli.py", line 1264, in onecmd
01:24:21     self.execute(line, previous_args)
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/cli.py", line 1346, in execute
01:24:21     args.func(args)
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/install/windows_warning.py", line 26, in wrapper
01:24:21     return func(self, *args, **kwargs)
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/plugins/prefs.py", line 78, in open_and_close_config
01:24:21     return func(*args, **kwargs)
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/plugins/admin.py", line 1475, in diagnostics
01:24:21     dir_size = self.getdirsize(omero_temp_dir)
01:24:21   File "/home/omero/workspace/OMERO-test-integration/src/dist/lib/python/omero/plugins/admin.py", line 1555, in getdirsize
01:24:21     total += os.path.getsize(os.path.join(values[0], filename))
01:24:21   File "/home/omero/workspace/OMERO-test-integration/omero-virtualenv/lib64/python2.7/genericpath.py", line 49, in getsize
01:24:21     return os.stat(filename).st_size
01:24:21 OSError: [Errno 2] No such file or directory: '/home/omero/omero/tmp/omero_omero/6014'

Another process created a temp directory at the beginning of the run, but finished and was removed before getdirsize had completed.

@sbesson
Copy link
Member

sbesson commented Dec 2, 2019

Overall the logic makes sense and I am surprised we have never encountered this scenario before on the shared devspace environment given the concurrency of the jobs. Off-hand I am assuming a race condition with the training job.

In the context of the temporary directory size, I think assumingdirectories might disappear during the calculation is safe and the code should prevent hard-failures. I do not see any other internal usage (https://github.com/search?q=org%3Aome+getdirsize&type=Code). Only question is whether we would like to be conservative for third-parties, implement a backwards-compatible implementation with some fails_on_missing=True flag that could be overriden by admin diagnostics.

@joshmoore
Copy link
Member Author

Pushed a strict flag.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming tomorrow's builds/deployment pass, proposing to get this merged and monitor the absence of such failures in the upcoming weeks.

@joshmoore joshmoore merged commit eeecb96 into ome:master Dec 3, 2019
@joshmoore joshmoore added this to the 5.6.0 milestone Mar 17, 2020
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 this pull request may close these issues.

None yet

2 participants