fs2-io is not closing ports when a DatagramChannel is used
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.5k
- Forks
- 636
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 7
Description
On fs2 3.13.0. I was testing usage of DatagramChannel with some code of mine in an integration test and noted that subsequent tests/suites would fail with the error java.net.BindException: Address already in use.
Attached is a minimal test case that shows the failure. It's not sufficient to merely create the DatagramChannel, it has to be used in a read/write. I believe the Selector registration may be at fault, it may not be being closed:
https://stackoverflow.com/questions/12977164/datagramchannel-close-keeps-port-open-on-windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the minimal DatagramChannel test case linked in the issue, especially the read/write path that leaves the port bound. Trace fs2-io's DatagramChannel handling and Selector registration through close, then verify that repeated tests or suites can bind the same port after the channel is closed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, scala
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100