-
Notifications
You must be signed in to change notification settings - Fork 638
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
Allow http file to be closed early #5405
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
The problem I see in this approach is that only works for What about if we something much more crazy, for example when opening (or closing the connection) inspect the current stack trace and determine the request is coming from a file path operation. |
Ok, forget about the stack trace thing, because still does not solve the problem (you may still want to read partially a stream via a Path). I think instead, we can apply something very similar to what you are suggesting using a reverse logic, i.e. enforcing the size check only when file transfer operation are made (not for generic stream operations). All file copies are made by the The fileCopy take some options that could be extend as you have implemented. What do you think? |
33458a4
to
6830712
Compare
I tried reversing the logic, so it only applies the check on file copy. It generally seems to work, but the Jimfs handler doesn't like it very much, and throws a |
If jimfs is blocking we could also consider something more dirty as a thread local flag |
@tom-seqera any eta or blocking issue for this ? |
6830712
to
a46231f
Compare
I managed to make it work by implementing |
Even if the OpenOption is a nice solution, I think it would be better to not change the copy implementation to make it work with a testing library. A thread local could be a better hack here |
Signed-off-by: Tom Sellman <[email protected]>
a46231f
to
6be448b
Compare
Neat! likely "Ready for review" ? |
Signed-off-by: Tom Sellman <[email protected]>
Proof of concept for #5360
This uses Java's OpenOption mechanism to pass a configuration param to the
XFileSystemProvider
, allowing a script to declare that it doesn't care if the input stream is closed before being fully read:This approach is quite flexible and generic, since it would also allow other
OpenOptions
to be passed to otherFileSystemProviders
, and as a result might be a little in conflict with the formalisation of a nextflow script syntax. An alternative could be to add a single-purpose method toXPath
, eg: