{"record":{"id":"ad7ab6714810fa93","repo":"apache/seatunnel","slug":"visibility-renewal-failed","errorCode":"VISIBILITY_RENEWAL_FAILED","errorMessage":"Azure Queue Storage message visibility renewal failed","messagePattern":"Azure Queue Storage message visibility renewal failed","errorType":"error_code","errorClass":"AzureQueueConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-azure-queue-storage/src/main/java/org/apache/seatunnel/connectors/seatunnel/azure/queue/source/AzureQueueStorageSourceReader.java","lineNumber":312,"sourceCode":"            for (List<AzureQueueMessage> pending : pendingAcknowledgements.values()) {\n                pending.remove(message);\n            }\n        }\n    }\n\n    private void sleepBeforeNextPoll() {\n        try {\n            Thread.sleep(config.getPollIntervalMillis());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            throw readFailure(\"Interrupted while polling Azure Queue Storage\", e);\n        }\n    }\n\n    private void checkVisibilityRenewalFailure() {\n        Throwable failure = visibilityRenewalFailure.get();\n        if (failure != null) {\n            throw new AzureQueueConnectorException(\n                    AzureQueueConnectorErrorCode.VISIBILITY_RENEWAL_FAILED,\n                    \"Azure Queue Storage message visibility renewal failed\",\n                    failure);\n        }\n    }\n\n    private AzureQueueConnectorException readFailure(String message, Throwable cause) {\n        return new AzureQueueConnectorException(\n                AzureQueueConnectorErrorCode.READ_FAILED, message, cause);\n    }\n\n    @FunctionalInterface\n    interface ReceiverFactory {\n        AzureQueueReceiver create();\n    }\n}\n","sourceCodeStart":294,"sourceCodeEnd":329,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-azure-queue-storage/src/main/java/org/apache/seatunnel/connectors/seatunnel/azure/queue/source/AzureQueueStorageSourceReader.java#L294-L329","documentation":"The reader renews message visibility in the background so long-processing messages are not reclaimed by the queue. checkVisibilityRenewalFailure() (called from pollNext) rethrows any stored renewal failure as AzureQueueConnectorException(VISIBILITY_RENEWAL_FAILED), failing the reader rather than silently letting messages become visible again and be reprocessed.","triggerScenarios":"A background renewal task stored a Throwable (network error, auth failure, message no longer exists / pop receipt invalid) and pollNext() subsequently checks and surfaces it.","commonSituations":"Records taking longer than visibility_timeout_seconds combined with renewal HTTP failures, transient Azure outages, expired/rotated credentials, or throttling (429) from the storage account.","solutions":["Retry the job — renewal failures are often transient network/Azure issues","Increase visibility_timeout_seconds and/or reduce per-record processing time","Verify credentials are valid and not recently rotated","Check Azure Storage throttling/metrics (429s) and account availability"],"exampleFix":"// before\nvisibility_timeout_seconds = 30   # renewal under heavy load fails\n// after\nvisibility_timeout_seconds = 300","handlingStrategy":"retry","validationCode":"// Ensure processing time is comfortably within visibility window\nif (maxProcessingMs > visibilityTimeoutSeconds * 1000L / 2) {\n    LOG.warn(\"processing time close to visibility timeout; renewal pressure high\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    reader.pollNext(collector);\n} catch (AzureQueueConnectorException e) {\n    if (e.getErrorCode() == AzureQueueConnectorErrorCode.VISIBILITY_RENEWAL_FAILED) {\n        LOG.warn(\"visibility renewal failed; restarting reader\", e.getCause());\n        // rely on engine restart / checkpoint recovery\n    }\n    throw e;\n}","preventionTips":["Set visibility_timeout_seconds generously above max record processing time","Ensure stable network to Azure Storage from workers","Handle credential rotation before expiry","Monitor renewal task failures and Azure 429 rates"],"tags":["azure","visibility","renewal","network"],"backgroundTag":"upstream-api-error","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"}