Skip to content
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

Enable TCP Keepalives between Tentacle and Octopus Server #692

Closed
nathanwoctopusdeploy opened this issue Nov 27, 2023 · 2 comments · Fixed by #717
Closed

Enable TCP Keepalives between Tentacle and Octopus Server #692

nathanwoctopusdeploy opened this issue Nov 27, 2023 · 2 comments · Fixed by #717
Assignees
Labels
team/server-at-scale Represents the Server at Scale team under the Hosting & Execution Group

Comments

@nathanwoctopusdeploy
Copy link
Contributor

nathanwoctopusdeploy commented Nov 27, 2023

What happened?

Octopus Server and Tentacle establish long-lived TCP connections to transfer Requests and Responses. The timeouts for Reads and Writes over the TCP connection can be up to 10 minutes by default.

If the TCP connection between Tentacle and Server fails and is not closed cleanly by both parties (FIN or RST packets are not sent and received), it can take up to 10 minutes for Tentacle to detect the TCP connection has failed and to terminate a waiting Read or Write.

This leads to undesirable delays when processing Requests and Responses.

Reproduction

Establish an active TCP connection between Server and Tentacle and ensure a Read or Write operation is waiting on Tentacle. Physically disconnect Server from the network (pull out a network cable) or force power off the machine Server is running on, ensuring the TCP connection is not closed gracefully.

As a FIN or RST is not received by Tentacle, the TCP Read or Write operation will continue to wait even though the established TCP connection has failed and Server is no longer available.

TCP Keepalives

Starting with Tentacle version 8.0.81 it is possible to enable TCP Keepalives between Tentalce and Server. This will ensure the connection is active and make the connection fail after ~60 seconds if there is an issue with the connection between Tentacle and Server.

As of 8.0.81 this is an opt-in feature and must be enabled for each Tentacle. A future update will enable this feature by default.

Manually opting-in

To opt-in to the feature, set an environment variable for the machine Tentacle is running on, or the Tentacle process.

TentacleTcpKeepAliveEnabled=true

Related

Async Halibut TCP Keep Alives
Adding option to enable TCP keep alives in Tentacle

@nathanwoctopusdeploy nathanwoctopusdeploy added the team/server-at-scale Represents the Server at Scale team under the Hosting & Execution Group label Nov 27, 2023
@nathanwoctopusdeploy nathanwoctopusdeploy self-assigned this Nov 27, 2023
@octoreleasebot
Copy link

Release Note: Enable TCP Keepalives between Tentacle and Octopus Server

@octoreleasebot
Copy link

Release Note: Enable TCP Keepalives between Tentacle and Octopus Server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team/server-at-scale Represents the Server at Scale team under the Hosting & Execution Group
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants