Skip to content

Fix file input in multi-node deployment#3130

Merged
jonatanklosko merged 1 commit intomainfrom
jk-multi-node-register-file
Feb 3, 2026
Merged

Fix file input in multi-node deployment#3130
jonatanklosko merged 1 commit intomainfrom
jk-multi-node-register-file

Conversation

@jonatanklosko
Copy link
Member

When LV uploads a file into a notebook file input, and the session is on a different node, we need to copy the file into the session node.

try do
source_path
|> File.stream!(64_000, [])
|> Enum.each(fn chunk -> IO.binwrite(file_pid, chunk) end)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can also use File.copy by passing two pids (the one in the open file and the one you received), or even a file path and a pid, and it will copy everything for you. But it is pretty much the same code as you have written here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice! With File.copy we would need to make sure to close both files in all failure cases, so this may actually be more code :D

@jonatanklosko jonatanklosko merged commit 9085070 into main Feb 3, 2026
4 checks passed
@jonatanklosko jonatanklosko deleted the jk-multi-node-register-file branch February 3, 2026 21:35
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.

2 participants