-
Notifications
You must be signed in to change notification settings - Fork 621
I/O polling #3240
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
I/O polling #3240
Conversation
Co-authored-by: Lee Tibbert <lee.tibbert@gmail.com>
Fixed in 500e545. |
|
Published |
|
Published |
|
This PR is now published as a release candidate. |
build.sbt
Outdated
| "org.typelevel" %%% "cats-effect" % "3.5.7", | ||
| "org.typelevel" %%% "cats-effect-laws" % "3.5.7" % Test, | ||
| "org.typelevel" %%% "cats-effect-testkit" % "3.5.7" % Test, | ||
| "org.typelevel" %%% "cats-effect" % "3.6.0-RC1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump to RC2 before merging?
|
|
||
| @alwaysinline def errnoToThrowable(e: CInt): Throwable = { | ||
| val msg = fromCString(strerror(e)) | ||
| if (e == EADDRINUSE /* || e == EADDRNOTAVAIL */ ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long ago ... I forgot why this is commented out 😅 I'll uncomment it and see if anything breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll uncomment it and see if anything breaks.
Ahh, it's because this was missing in SN 0.4.x but added in 0.5.x. We can uncomment it soon :)
| } | ||
|
|
||
| test("read after timed out read not allowed on JVM or Native") { | ||
| test("read after timed out read not allowed on JVM or Native".ignore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not passing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the new polling implementation actually allows this behavior. A read can timeout without corrupting the socket because we are only canceling the select. The old implementation using the JDK's AsynchronousSocketChannel doesn't support cancelable reads.
Technically the test is still relevant to the old implementations (which I guess we aren't testing anymore).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice, that always felt like an annoying restriction. Can we flip this test around to assert this works as expected now then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, good idea!
This PR is published as FS2 v3.12.0-RC1.
Upgrades to Cats Effect
v3.6.0-RC1 which includes the new I/O polling system.3.6-e9aeb8cThe following APIs can be implemented with I/O polling. I've done some in this PR, the rest might end up in follow-up PRs.
JVM
Selector-based I/OSocketGroupandSocketDatagramSocketGroupandDatagramSocketUnixSocketsNative file descriptor polling-based I/O
SocketGroupandSocketDatagramSocketGroupandDatagramSocketUnixSocketsProcessesandProcessfs2.io.{stdin,stdout,stderr}