-
Notifications
You must be signed in to change notification settings - Fork 116
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
AFUNIXSocketChannel selector not working with jetty #108
Comments
Yes, they're available. Make sure to use junixsocket 2.5.0 or newer since a few bugs have been fixed there. Here's some code to get started:
Also see the |
When JunixSocket is used through the Jetty extension, AFSelector.select() appears to be invalid and the corresponding key cannot be obtained. |
Can you provide some test code that shows the bug? What's the error message / stack trace? |
|
Previously, we weren't properly updating the interestOps data structure in PollFd when a SelectionKey's interestOps were changed after the fact. This prevented Jetty to work with junixsocket. #108
Please verify with the latest junixsocket 2.5.1-SNAPSHOT. You may need to add the following statements to your project's Maven POM:
|
OK,I'll try. thank you very much |
This artifact provides junixsocket-compatible jetty connectors. The server connector should be compatible with jetty >= 9.4.12. The client connector should be compatible with jetty >= 10.0.8. Related to #108
Please also see the most recent addition to junixsocket (also available in the snapshots repository): junixsocket-jetty. This artifact provides both a server connector (jetty >= 9.4.12) and a client connector (jetty >= 10.0.8). Please give it a try and let me know if that works for you. |
Due to historical reasons, we cannot upgrade JDK11 and Jetty10. Can we provide solutions based on JDK8 and Jetty9? |
A great way to find more bugs, thank you! Please try again with the latest snapshot (>= junixsocket 2.5.1-20220625.155644) or anything with commit 6d324a6 or later. |
@joakime Did you try with the latest build I mentioned? Can you reproduce your issue? I threw a bunch of parallel requests at it, and it seems to work for me, also with multiple selectors. Are you seeing a concrete issue with junixsocket's handling of Regarding
So I think that is not the NIO requirement you mention. Is there additional documentation around this point? By the way, there was an indeed a bug in the client connector side of things (missing Selector implementation override). I've now added (a slightly modified) I wonder what else is missing? Please test with the latest snapshot (20220626.130729-5 or newer), or commit d366394 or newer from git. |
@joakime I'm not so worried by that locking... if/when we do call select() from multiple threads, we expect the implementation to internally mutually exclude and one to eventually to respond and the next to then take over and block waiting for further events. So that locking is fine. Also, I think with our latest code, where the selector is always called from our producer, we should no longer do concurrent calls to select anyway. But each select is highly likely to be done by a different thread as we prefer to allow any thread woken up in a select call to proceed to handle those selections rather than hand off to another thread (likely on different CPU with cold cache etc.). However, we definitely do expect a blocking call to select to not immediately return with 0, else we end up in a busy loop. Previously we made efforts to detect such loops as it was decided it was better to die and allow a restart rather than to continue to hammer on a non functional busy loop selector. But our currect code no longer detects such a case, rather it only has the option to try a selectNow instead before looping. So if select() does return 0 without pause, you will be in a busy loop. |
@gregw @usertree Now it would be a great time to verify that everything works for you with the latest code. Since it includes some bug fixes, I'd like to release 2.5.1 soon. If I don't hear from you until Thursday (June 30), I will assume everything works now (but I might be slightly sad that you didn't reply). Cheers! |
Which version can I use, currently using 2.5.1 - SNAPSHOT still has seletor concurrency issues. |
@usertree Please verify that you test with 2.5.1-20220628.145818-6.
|
Sorry I can't rely on 2.5.1-20220628.145818-6 from https://oss.sonatype.org/content/repositories/snapshots/. In addition, the list of snapshots cannot be viewed. |
I'm not sure I understand what "can't rely" means in this context. I assume you're having problems accessing that snapshot? If you run your tests on your own machine, try deleting your m2 repository cache for junixsocket, e.g.,, delete the contents in If you're still having issues to get the right snapshot, I'd recommend trying to build junixsocket from source. I'm pretty confident that we've captured the |
Please verify with 2.5.1; just released. Thanks! |
No problem is found in the local verification with 2.5.1. The verification will be performed in the environment later. |
Closing resolved ticket due to inactivity. Please re-open if you find any problems. Thanks for reporting! |
👋 requesting to reopen this issue because we ran into response problems when using the jetty symptoms:
|
@kevink-sq Thanks for the update! This looks like a different bug. Can you please file a new issue with some code to replicate this? Cheers! |
@kevink-sq Following up with #135 |
Are AFUNIXSocketChannel and AbstractSelector available? Can you provide an example?
The text was updated successfully, but these errors were encountered: