-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
airbyte-common-workers: Collect trace message on failed connection_status #20721
airbyte-common-workers: Collect trace message on failed connection_status #20721
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this on a call, but leaving a comment for posterity:
Looks good overall, but we should:
- Add testing for the changes on both WorkerUtils and DefaultCheckConnectionWorker
- Look into following the same approach of always looking for trace messages in the other synchronous commands (spec, discover)
@pedroslopez I tried to increase the shared logic between SPEC, DISCOVER and CHECK. I'd be interested in getting your opinion about the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good logically, most of my comments are around making things a bit clearer but non-blocking.
The only thing I'd like to see before approving is some additional tests for WorkerUtils / Default***Workers.
...te-commons-worker/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java
Outdated
Show resolved
Hide resolved
...te-commons-worker/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java
Outdated
Show resolved
Hide resolved
@pedroslopez I tried to make things a bit more readable and explicit:
This logic is kept within the worker classes (Default*Worker.java), the Worker utils class only has utils to extract useful objects from messages. I'll add the tests if the overall logic looks good to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I think this makes it much clearer. Only one comment about reassigning the job output that is non-blocking - just waiting on the tests 😄
...te-commons-worker/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java
Outdated
Show resolved
Hide resolved
...te-commons-worker/src/main/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorker.java
Outdated
Show resolved
Hide resolved
…ub.com:airbytehq/airbyte into augustin/check/collect-trace-message-on-0-exit
…ub.com:airbytehq/airbyte into augustin/check/collect-trace-message-on-0-exit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks pretty good -- I added a few clarifying questions mostly for my own understanding! Following the logic, it looks like this
- looks for a connection status message
- looks for failure reasons in check connection messages
- sets the failure reason of the job if there's failure reasons
- if we got a connection status message, set the checkConnection output of the jobOutput
- if no connection status message and no failure reason, throw
- return the jobOutput
I followed the logic for checkConnection, and glanced over the other 2 jobs.
A few things that might have helped understand this better at first glance of a new code base:
- the existence CONNECTION_STATUS messages are being used to determine success, I think. could one consider a
connectionStatus
to be something like a connectionSuccess or connectionConfirmation? - I wonder if it would be worth adding a method
isSuccess
orisSuccessful
that returnsoutput.getCheckConnection != null
? (and similar for the other methods)? On spec, it's relatively intuitive that ifgetSpec
is null, the job failed, but forgetCheckConnection
, as someone new to the code base, it feels like a method namedgetCheckConnection
could contain information about a failed job or a successful job - I have to look at the code to see that it only gets set in the case of success.
What
Closes #18865
Synchronous commands like SPEC, DISCOVER and CHECK can output trace messages that are not currently captured as failure reasons when the process exits with a
0
status code.This PR aims at normalizing the behavior of these three commands:
How
Implement an explicit logic in:
airbyte/airbyte-commons-worker/src/main/java/io/airbyte/workers/general/DefaultGetSpecWorker.java
Line 54 in 1f6c310
airbyte/airbyte-commons-worker/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java
Line 59 in 1f6c310
airbyte/airbyte-commons-worker/src/main/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorker.java
Line 66 in 1f6c310