We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While writing the test for #3763 I realized there is another critical bug :
require "socket" def check_file(prefix, file) if File.exists? file puts "#{prefix} File exists" else puts "#{prefix} No file" end end path = "/tmp/important_file" # create an important file File.write path, "important content" check_file "Touch/", path # try to bind begin UNIXServer.new path rescue err puts "Error raised !" puts check_file "Server/", path puts "Error was: #{err.message}" end
Output for master, Crystal 0.20.3 :
Using compiled compiler at .build/crystal Touch/ File exists Error raised ! Server/ No file Error was: bind: Address already in use
It is caused by the close in UNIXServer#new L32 Which will delete the file if you cannot bind to it
close
The text was updated successfully, but these errors were encountered:
Yes, I think this is a bug. The file should only be deleted on close if it's successfully bound.
I also tried it in Ruby (rescue => err instead of rescue err) and it doesn't delete the file.
rescue => err
rescue err
Sorry, something went wrong.
Yes. I'll fix that.
Fix: UNIXServer shouldn't delete path on bind failures
04b1820
fixes crystal-lang#3764
@Bew78LesellB thanks for detecting this issue!
f0009cd
3512d3c
fixes #3764
ysbaddaden
Successfully merging a pull request may close this issue.
While writing the test for #3763 I realized there is another critical bug :
Output for master, Crystal 0.20.3 :
It is caused by the
close
in UNIXServer#new L32Which will delete the file if you cannot bind to it
The text was updated successfully, but these errors were encountered: