-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
explicitly close socat socket #12632
Conversation
09dce22
to
dad85ff
Compare
because AirbyteSource is an AutoCloseable close should be idempotent though so calling it multiple times is fine
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 great Peter
try { | ||
source.close(); | ||
} catch (final Exception e) { | ||
throw new SourceException("Source cannot be stopped!", e); |
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 love this exception. it sounds like Godzilla is coming from the water and cannot be contained
airbyte-workers/src/test/java/io/airbyte/workers/DefaultReplicationWorkerTest.java
Show resolved
Hide resolved
did a final verification in a dev env that everything works as expected (discovers, syncs, etc.) |
* explicitly close socat socket * source can be closed multiple times because AirbyteSource is an AutoCloseable close should be idempotent though so calling it multiple times is fine
What
closes #11621
Currently the way we handle sending messages from the source pod to the orchestrator pod is:
We can see this in a sample of the socat logs.
The problem with this approach is that we have seen cases where it appears that the source pod has already terminated before the orchestrator is able to fully process all the incoming data. This leaves the network socket in a bad state and the orchestrator pod simply hangs. #11621 (comment) for more details on how this might happen.
A more reliable way to handle this interaction should be:
This new flow should avoid the problems arising from the source initiating the shutdown. This is also how socat is intended to work.
http://www.dest-unreach.org/socat/doc/socat.html
How
With this change the socat logs now look like
(note that socket 2 also has an EOF now)