wenjin272 commented on code in PR #948:
URL: https://github.com/apache/flink-agents/pull/948#discussion_r3703439520
##########
runtime/src/main/java/org/apache/flink/agents/runtime/actionstate/KafkaActionStateStore.java:
##########
@@ -331,11 +331,14 @@ public Object getRecoveryMarker() {
@Override
public void close() throws Exception {
- if (producer != null) {
- producer.close();
- }
- if (consumer != null) {
- consumer.close();
+ try {
+ if (producer != null) {
+ producer.close();
+ }
+ } finally {
+ if (consumer != null) {
+ consumer.close();
Review Comment:
If both `producer.close()` and `consumer.close()` throw, the consumer
exception replaces the producer exception, contradicting the stated behavior
and hiding the original failure. Could we preserve the producer exception and
add the consumer exception as suppressed, with a test covering this case?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]