RFR: 8310994: Add JFR event for selection operations [v2]
Daniel Fuchs
dfuchs at openjdk.org
Wed Dec 13 18:57:42 UTC 2023
On Wed, 13 Dec 2023 18:38:11 GMT, Tim Prinzing <tprinzing at openjdk.org> wrote:
>>> It could also be interesting to provide the `timeout` that was given to the selection operation.
>>
>> I've tried to work through issues, esp. around selector spinning, and being able to distinguish select from selectNow is important for all of them, so yes, the timeout is needed or else no emit when the timeout == 0 as that's the case you have to filter out when troubleshooting.
>
> I've added filtering of selectNow(), and an event is emitted if there is a timeout independent of the threshold. The duration should roughly equal the timout in that case. I added more test cases to cover those two changes.
The select call may also exit early with 0 key selected if it was woken up by a call to Selector::wakeup and this is not necessarily indicative of an issue in the API. We use this facility a lot in the HttpClient as we also use the selector thread as a timer thread.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16710#discussion_r1425760691
More information about the nio-dev
mailing list