-
Notifications
You must be signed in to change notification settings - Fork 3
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
mktemp is using a directory that doesn't yet exist? #8
Comments
Ah, and I see it in submitted jobs on JuliaHub, too. Code: using DataSets, CSV, DataFrames
blob = open(Blob, dataset("us_counties"))
df = open(io->CSV.read(io, DataFrame), IO, blob)
@show length(df)
ENV["OUTPUTS"] = """{
"len":$(length(df))
}""" Error:
|
I think the problem here is that the blob cache isn't persistent - it assumes you use it in scoped form:
I've been finding the scoped-form-vs-not is a bit of a design catch-22:
I guess I should figure out a way to disable the non-scoped form |
Relying on the OS to clean up |
Perhaps I'm missing something, but finalizers are the typical way to do this. Do finalizers not work for this? The general pattern is: let people use the block form for deterministic scoped cleanup but use finalizers to allow unscoped cleanup whenever GC determines that something is no longer reachable. In this case there's even a |
@c42f, does that make sense? Is there any issue with using finalizers for this? |
Yeah sorry, I was thinking about this yesterday and trying to write down my thoughts. I do try to avoid finalizers if at all possible so I'd kind of forgotten about them for this use case. But they're really the only tool we have at hand here. Supporting both finalizers as well as the scoped form does change the API which data backends will need to implement. The job of a data backend (in, for example,
which initializes the resources needed by the backend, runs If we want (As an aside, there's also the a transformation which can turn any scoped resource handling into a state machine using the |
Why does everybody hate finalizers? They're very useful. |
Because they run on whatever random task happens to be running the GC so there's no good way to deal with failure inside a finalizer. Any exceptions get swallowed because there's no context in which to report them. Task switching is disallowed, so even logging the error is more difficult than it should be. All of that makes finalizers a poor place to deal with operations that can fail so I try to only use them as a last resort. |
I have a potential fix for this at #12. Yes, I did feel the need to implement a whole new resource management package just to fix this issue 😅 |
Should be fixed in #12 and release 0.2.3 |
I have a blob. I try to open it. I get:
I redefined
mktemp
to show me what it's trying to do:I make that directory:
shell> mkdir /tmp/jl_Oh98Jz
And now it works:
(This is in VS Code on JuliaHub, using the workaround to get a Data.toml from JuliaHub)
The text was updated successfully, but these errors were encountered: