-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented transient error handling for system errors in MSSQL (#48484)
- Loading branch information
1 parent
bb880c4
commit 806f810
Showing
5 changed files
with
207 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...mssql/src/main/kotlin/io/airbyte/integrations/source/mssql/MSSqlSourceExceptionHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.source.mssql | ||
|
||
import io.airbyte.cdk.integrations.util.ConnectorErrorProfile | ||
import io.airbyte.cdk.integrations.util.ConnectorExceptionHandler | ||
import io.airbyte.cdk.integrations.util.FailureType | ||
|
||
class MSSqlSourceExceptionHandler : ConnectorExceptionHandler() { | ||
override fun initializeErrorDictionary() { | ||
|
||
val DATABASE_READ_ERROR = "Encountered an error while reading the database, will retry" | ||
|
||
// include common error profiles | ||
super.initializeErrorDictionary() | ||
|
||
// adding connector specific error profiles | ||
add( | ||
ConnectorErrorProfile( | ||
errorClass = "MS SQL Exception", // which should we use? | ||
regexMatchingPattern = | ||
".*returned an incomplete response. The connection has been closed.*", | ||
failureType = FailureType.TRANSIENT, | ||
externalMessage = DATABASE_READ_ERROR, | ||
sampleInternalMessage = | ||
"com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server returned an incomplete response. The connection has been closed.", | ||
referenceLinks = listOf("https://github.com/airbytehq/oncall/issues/6623") | ||
) | ||
) | ||
} | ||
} |
Oops, something went wrong.