[ruby-core:117777] [Ruby master Bug#20471] Problem creating a file on a windows share and copy it afterwards
From:
"budiljak (Benjamin Udiljak) via ruby-core" <ruby-core@...>
Date:
2024-05-05 13:37:43 UTC
List:
ruby-core #117777
Issue #20471 has been updated by budiljak (Benjamin Udiljak).
nobu (Nobuyoshi Nakada) wrote in #note-1:
> budiljak (Benjamin Udiljak) wrote:
> > I also tried `f.fsync` , `f.fdatasync` , `f.flush`, but it didn't help.
>
> Have you tried `sleep 1` (or more seconds) after the `File.open` block?
Yes. I even tried 5 seconds, but it didn't help neither.
----------------------------------------
Bug #20471: Problem creating a file on a windows share and copy it afterwards
https://bugs.ruby-lang.org/issues/20471#change-108184
* Author: budiljak (Benjamin Udiljak)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Hi,
in my Rails application I have the requirement to create a file and copy it to another place on the same windows share. But if I write the file with `File` class and try to copy it with `FileUtils.cp` it hangs indefinitely without any error message. I can't even kill the ruby process.
You can easily reproduce the bug by entering this in IRB:
```
filename = "/mnt/windows_share/abc"; File.open(filename, 'wb') { |f| f.write("123" * 1000) }; FileUtils.cp(filename, filename + "d")
```
I tested this on a Ubuntu 22.04 server in the AWS cloud.
I also tried `f.fsync` , `f.fdatasync` , `f.flush`, but it didn't help.
Probably it's a problem in connection with the `cifs-utils` package.
Please come back to me if you need further information.
Regards!
Ben
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/