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
fix: issue1460 intermediate files existing (or not) #1541
Conversation
Please format your code with black: |
6e10aa6
to
3dd860a
Compare
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
3dd860a
to
c04fb4c
Compare
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
the issue is that the blob object held by a GS remote object can go sort of stale, returning a False for blob.exists() when it clearly exists! To fix we need to do an additional self.update_blob() and then returning the exists check again. I am not sure if this can be made more efficient by only checking under certain conditions, but since it seems likely we cannot perfectly know when the blob has gone stale the sure way is to always update. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
3bdc7bb
to
136b0e0
Compare
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
okay doing a little testing - I've gotten down to the io.py function to wait for files, and looking at the files and attributes, according to this, one of them does not exist: indeed it does exist! It comes down to checking if a remote object exists, e.g., self.blob.exists() erroneously returns False: Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: self.blob
Out[1]: <Blob: snakemake-testing-d924es45, test_github_issue1460/preblob.txt, 1648855265000563>
In [2]: self.blob.exists()
Out[2]: False but there it is!
self.blob.reload()
...
NotFound: 404 GET https://storage.googleapis.com/storage/v1/b/snakemake-testing-d924es45/o/test_github_issue1460%2Fpreblob.txt?generation=1648855265000563&projection=noAcl&prettyPrint=false: No such object: snakemake-testing-d924es45/test_github_issue1460/preblob.txt But indeed if we "ask again" for the key, we see it exists:
so that's the change I did for the PR here - looks like the reproducing test of the bug passes, so we fixed it! There might be some ways to further optimize (e.g., only do the update_blob under some conditions) but someone else can look into that if desired. Thanks for letting me play on GCP this evening @johanneskoester it was SO fun I missed it a lot <3 |
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Awesome work @vsoch, thanks a lot! |
Description
Just testing different ideas for #1460 - feel free to ignore!
QC
docs/
) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).