[JAVA-4024] AsynchronousTlsChannelGroup#processPendingInterests can throw CancelledKeyException Created: 27/Feb/21  Updated: 28/Oct/23  Resolved: 01/Mar/21

Status: Closed
Project: Java Driver
Component/s: Async, Connection Management
Affects Version/s: None
Fix Version/s: 4.2.2

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

See https://github.com/marianobarrios/tls-channel/issues/18, which appears to be a bug in the tls-channel repository that he driver vendors.

This is the root cause of many of the occasional failures of the RetryableWritesTest and RetryableReads tests in the reactive streams driver.



 Comments   
Comment by Githook User [ 27/Feb/21 ]

Author:

{'name': 'jyemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Ignore CancelledKeyException in AsynchronousTlsChannelGroup#loop

In testing we've observed that SelectionKey#interestOps can sometimes
throw a CancelledKeyException when channels are being closed forcefully
by the server in response to operations with failpoints set on them.

CancelledKeyException is already ingored elsewhere in
AsynchronousTlsChannelGroup, and it seems it has to also be ignore
in the processPendingInterests method.

JAVA-4024
Branch: 4.2.x
https://github.com/mongodb/mongo-java-driver/commit/84c3c836c5c9adf0bcd414a90b150e653673d2a8

Comment by Jeffrey Yemin [ 27/Feb/21 ]

Upstream bug closed, merged in change.

Comment by Githook User [ 27/Feb/21 ]

Author:

{'name': 'jyemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Ignore CancelledKeyException in AsynchronousTlsChannelGroup#loop

In testing we've observed that SelectionKey#interestOps can sometimes
throw a CancelledKeyException when channels are being closed forcefully
by the server in response to operations with failpoints set on them.

CancelledKeyException is already ingored elsewhere in
AsynchronousTlsChannelGroup, and it seems it has to also be ignore
in the processPendingInterests method.

JAVA-4024
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/4d375c8531c6e3ff4f2b208477fb31eacd5ce2f7

Generated at Thu Feb 08 09:01:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.