https://github.com/jscheid/socketry-async-368
https://github.com/socketry/async/issues/368
https://github.com/jscheid/socketry-async-368
Last synced: 2 months ago
JSON representation
https://github.com/socketry/async/issues/368
- Host: GitHub
- URL: https://github.com/jscheid/socketry-async-368
- Owner: jscheid
- Created: 2025-01-10T15:42:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-13T21:56:35.000Z (over 1 year ago)
- Last Synced: 2025-12-25T23:35:51.566Z (6 months ago)
- Language: Ruby
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test case for `UDPSocket#close` hanging
See https://github.com/socketry/async/issues/368
This is the behaviour I can observe on my machine:
## Running on macOS with Ruby 3.3.0
Running `statsd.timing` only in sync blocks works fine:
```
bundle && bundle exec ruby test.rb 0 # returns after a second or so
```
Running 50/50 sync and async will hang:
```
bundle && bundle exec ruby test.rb 0.5 # hangs
```
So does running with only async, no sync:
```
bundle && bundle exec ruby test.rb 1 # hangs
```
## Running in Docker with Ruby 3.4.1
Running only sync blocks works fine:
```
docker compose run --rm -e ASYNC_PERCENT=0 test # returns after a second or so
```
Unlike running on the host, so does running _only_ async blocks:
```
docker compose run --rm -e ASYNC_PERCENT=1 test # returns after a second or so
```
But, running 50/50 sync and async will hang again:
```
docker compose run --rm -e ASYNC_PERCENT=0.5 test # hangs
```
## Poking around the process
In one terminal:
```
docker compose up test # hangs
```
In another terminal:
```
docker compose exec test bundle exec pry-remote
```
In the pry console:
```ruby
$tasks.each(&:print_hierarchy)
```
... should show one fiber hanging in `IO#close`, the others waiting to get the Mutex.