-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Closed stream / Bad file descriptor on TCP Server example #120
Comments
Seeing similar results when attempting to connect to PostgreSQL on localhost. With or without require 'polyphony/adapters/postgres' I'm getting a |
Can you include a working reproduction code? |
This seems to be a simple matter of variable shadowing. In the first example, the value of while (client = server.accept)
spin do
data = client.gets(8192)
client << "you said: #{data}"
client.close
end
end You should either call server.accept_loop do |client|
spin do
data = client.gets(8192)
client << "you said: #{data}"
client.close
end
end I'll make sure to update the bundled examples to work correctly. |
@noteflakes I've meet the same issue and made a reproduction code here: https://github.com/v-kolesnikov/bug-sequel-fibers/blob/polyphony/run.rb Run log |
Hi! Thank you for your work in Polyphony!
We were testing polyphony internally and we ran into some issues. To make sure it was not our code, we tried running the TCP Server example and we've got the same issue.
The issue is, if we run multiple clients connection to the server by running multiple nc loops, like so:
Then, when we start the server, it runs for some time before giving us one of the following two errors:
or
The issue varies both in how long it takes to happen and which one happens first. (Also, the line number is a bit different because we added a few
puts
to see what was happening, but it happens without theputs
there too), but it never takes longer than a few minutes (usually quite quick, actually).To make matters more interesting, we tried the Http simple server that was recently committed and we didn't have the same issue at first, but we stripped it down further and further to get close to the example and when the code looks like this it gives us the issue:
However, this does not seem to give the issue:
Here's more details:
polyphony version:
1.6
Ruby version:
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
Uname:
Linux 6.4.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 11 Aug 2023 11:03:36 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: