{"record":{"id":"4c55c0cb65346257","repo":"apache/seatunnel","slug":"failed-to-close-google-pub-sub-subscriber","errorCode":null,"errorMessage":"Failed to close Google Pub/Sub subscriber","messagePattern":"Failed to close Google Pub/Sub subscriber","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/source/GooglePubSubSubscriber.java","lineNumber":181,"sourceCode":"                    if (failure == null) {\n                        failure = timeout;\n                    } else {\n                        failure.addSuppressed(timeout);\n                    }\n                }\n            } catch (InterruptedException e) {\n                Thread.currentThread().interrupt();\n                emulatorChannel.shutdownNow();\n                if (failure == null) {\n                    failure = e;\n                } else {\n                    failure.addSuppressed(e);\n                }\n            }\n        }\n\n        if (failure != null) {\n            throw new IOException(\"Failed to close Google Pub/Sub subscriber\", failure);\n        }\n    }\n}\n","sourceCodeStart":163,"sourceCodeEnd":185,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/source/GooglePubSubSubscriber.java#L163-L185","documentation":"GooglePubSubSubscriber.close() shuts down the subscriber and optional emulator gRPC channel, aggregating exceptions via addSuppressed and throwing an IOException(\"Failed to close Google Pub/Sub subscriber\") if any shutdown step failed. Unlike the others it is an IOException, not a connector exception.","triggerScenarios":"subscriber.stopAsync().awaitTerminated() throws (IllegalStateException because the subscriber was already failed), or channel shutdown throws while closing resources.","commonSituations":"Close called after an earlier subscriber failure (state already FAILED); interrupted during graceful shutdown; double-close in abnormal task teardown paths.","solutions":["Inspect the suppressed exceptions for the real cause","This usually masks a prior failure — check logs for the earlier subscriber error","Safe to ignore in cleanup paths if the job is already failing; the task abort will handle it","Avoid double-close; ensure close is called once per reader lifecycle"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { subscriber.close(); } catch (IOException e) { log.warn(\"close failed, suppressed: {}\", Arrays.toString(e.getSuppressed())); }","preventionTips":["Always close once per lifecycle (try-with-resources)","Check earlier logs — close failure usually masks a prior subscriber failure","Don't abort a job solely because cleanup close threw"],"tags":["pubsub","shutdown","resource-cleanup"],"backgroundTag":"invalid-state-transition","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}