Skip to content

add keepalive for TCP socket in KubePodProcess #10528

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

Merged
merged 2 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7825,7 +7825,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-tiktok-marketing:0.1.4"
- dockerImage: "airbyte/source-tiktok-marketing:0.1.5"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/tiktok-marketing"
changelogUrl: "https://docs.airbyte.io/integrations/sources/tiktok-marketing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ private void setupStdOutAndStdErrListeners() {
try {
LOGGER.info("Creating stdout socket server...");
final var socket = stdoutServerSocket.accept(); // blocks until connected
// cat /proc/sys/net/ipv4/tcp_keepalive_time
// 300
// cat /proc/sys/net/ipv4/tcp_keepalive_probes
// 5
// cat /proc/sys/net/ipv4/tcp_keepalive_intvl
// 60
socket.setKeepAlive(true);
LOGGER.info("Setting stdout...");
this.stdout = socket.getInputStream();
} catch (final IOException e) {
Expand All @@ -531,6 +538,7 @@ private void setupStdOutAndStdErrListeners() {
try {
LOGGER.info("Creating stderr socket server...");
final var socket = stderrServerSocket.accept(); // blocks until connected
socket.setKeepAlive(true);
LOGGER.info("Setting stderr...");
this.stderr = socket.getInputStream();
} catch (final IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public boolean isFinished() {
Preconditions.checkState(destinationProcess != null);
// As this check is done on every message read, it is important for this operation to be efficient.
// Short circuit early to avoid checking the underlying process.
final var isEmpty = !messageIterator.hasNext();
final var isEmpty = !messageIterator.hasNext(); // hasNext is blocking.
if (!isEmpty) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean isFinished() {
Preconditions.checkState(sourceProcess != null);
// As this check is done on every message read, it is important for this operation to be efficient.
// Short circuit early to avoid checking the underlying process.
final var isEmpty = !messageIterator.hasNext();
final var isEmpty = !messageIterator.hasNext(); // hasNext is blocking.
if (!isEmpty) {
return false;
}
Expand Down