Skip to content
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

gets() hangs on Windows #256

Open
emiltin opened this issue Jun 29, 2023 · 6 comments
Open

gets() hangs on Windows #256

emiltin opened this issue Jun 29, 2023 · 6 comments

Comments

@emiltin
Copy link
Contributor

emiltin commented Jun 29, 2023

Hi,
Running this on Mac and Linux:

input, output = IO.pipe
Async do
  puts "starting"
  Async do
    puts "reading..."
    line = input.gets
    puts "got #{line.inspect}"
  end
  puts "writting..."
  output.puts "hello"
end

outputs:

starting
reading...
writting...
got "hello\n"

But on Windows it just outputs:

starting
reading...

and then hangs. It seems the call to input.gets()blocks?

I'm running the Windows code in a Github Workflow:
Microsoft Windows Server 2022, 10.0.20348
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]
Using async 2.6.2
Using async-io 1.35.0
Using bundler 2.4.13

@emiltin
Copy link
Contributor Author

emiltin commented Aug 8, 2023

I cannot reproduce this with async 2.6.3, closing.

@emiltin emiltin closed this as completed Aug 8, 2023
@ioquatix
Copy link
Member

ioquatix commented Aug 8, 2023

Wow great, thanks for reporting back!

@emiltin
Copy link
Contributor Author

emiltin commented Aug 10, 2023

It seems I was too quick to close this. The original example at the top still hangs on Windows.
As mentioned, I'm running this in a GitHub Action, that runs a Ruby file with the example in.

I'll try to make a PR with a new test.

@emiltin emiltin reopened this Aug 10, 2023
@emiltin emiltin mentioned this issue Aug 10, 2023
3 tasks
@emiltin
Copy link
Contributor Author

emiltin commented Jun 12, 2024

Hi,
Any plans for adding Windows to the test matrix? This seems still to hang on Windows.

@ioquatix
Copy link
Member

Yes, but it's slow. I started writing support for IOCP in io-event gem.

@emiltin
Copy link
Contributor Author

emiltin commented Jun 12, 2024

Cool, thank you for the response.

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

No branches or pull requests

2 participants