Skip to content

Commit

Permalink
[DB sources] : Exit when encountering a config error (#38538)
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkulk authored May 29, 2024
1 parent d39d2e6 commit a2bcd49
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 30 deletions.
1 change: 1 addition & 0 deletions airbyte-cdk/java/airbyte-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ corresponds to that version.

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.36.2 | 2024-05-29 | [\#38538](https://github.com/airbytehq/airbyte/pull/38357) | Exit connector when encountering a config error. |
| 0.36.0 | 2024-05-29 | [\#38358](https://github.com/airbytehq/airbyte/pull/38358) | Plumb generation_id / sync_id to destinations code |
| 0.35.14 | 2024-05-28 | [\#38738](https://github.com/airbytehq/airbyte/pull/38738) | make ThreadCreationInfo cast as nullable |
| 0.35.13 | 2024-05-28 | [\#38632](https://github.com/airbytehq/airbyte/pull/38632) | minor changes to allow conversion of snowflake tests to kotlin |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ internal constructor(
ConnectorExceptionUtil.getDisplayMessage(rootConfigErrorThrowable),
)
// On receiving a config error, the container should be immediately shut down.
System.exit(1)
} else if (ConnectorExceptionUtil.isTransientError(rootTransientErrorThrowable)) {
AirbyteTraceMessageUtility.emitTransientErrorTrace(
e,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.36.1
version=0.36.2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
import java.util.function.Consumer
import org.apache.commons.lang3.ThreadUtils
import org.assertj.core.api.AssertionsForClassTypes
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -221,32 +220,6 @@ internal class IntegrationRunnerTest {
Mockito.verify(jsonSchemaValidator).validate(any(), any())
}

@Test
@Throws(Exception::class)
fun testReadException() {
val intConfig = IntegrationConfig.read(configPath, configuredCatalogPath, statePath)
val configErrorException = ConfigErrorException("Invalid configuration")

Mockito.`when`(cliParser.parse(ARGS)).thenReturn(intConfig)
Mockito.`when`(source.read(CONFIG, CONFIGURED_CATALOG, STATE))
.thenThrow(configErrorException)

val expectedConnSpec = Mockito.mock(ConnectorSpecification::class.java)
Mockito.`when`(source.spec()).thenReturn(expectedConnSpec)
Mockito.`when`(expectedConnSpec.connectionSpecification).thenReturn(CONFIG)

val jsonSchemaValidator = Mockito.mock(JsonSchemaValidator::class.java)
val throwable =
AssertionsForClassTypes.catchThrowable {
IntegrationRunner(cliParser, stdoutConsumer, null, source, jsonSchemaValidator)
.run(ARGS)
}

AssertionsForClassTypes.assertThat(throwable).isInstanceOf(ConfigErrorException::class.java)
// noinspection resource
Mockito.verify(source).read(CONFIG, CONFIGURED_CATALOG, STATE)
}

@Test
@Throws(Exception::class)
fun testCheckNestedException() {
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mysql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

airbyteJavaConnector {
cdkVersionRequired = '0.35.11'
cdkVersionRequired = '0.36.2'
features = ['db-sources']
useLocalCdk = false
}
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data:
connectorSubtype: database
connectorType: source
definitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
dockerImageTag: 3.4.5
dockerImageTag: 3.4.6
dockerRepository: airbyte/source-mysql
documentationUrl: https://docs.airbyte.com/integrations/sources/mysql
githubIssueLabel: source-mysql
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Any database or table encoding combination of charset and collation is supported

| Version | Date | Pull Request | Subject |
|:--------|:-----------| :--------------------------------------------------------- |:------------------------------------------------------------------------------------------------------------------------------------------------|
| 3.4.6 | 2024-05-29 | [38538](https://github.com/airbytehq/airbyte/pull/38538) | Exit connector when encountering a config error. |
| 3.4.5 | 2024-05-23 | [38198](https://github.com/airbytehq/airbyte/pull/38198) | Sync sending trace status messages indicating progress. |
| 3.4.4 | 2024-05-15 | [38208](https://github.com/airbytehq/airbyte/pull/38208) | disable counts in full refresh stream in state message. |
| 3.4.3 | 2024-05-13 | [38104](https://github.com/airbytehq/airbyte/pull/38104) | Handle transient error messages. |
Expand Down

0 comments on commit a2bcd49

Please sign in to comment.