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

feat(backend): Support configuring connection keepalive parameters #1275

Merged
merged 7 commits into from
Aug 7, 2024

Conversation

ulyssa
Copy link
Contributor

@ulyssa ulyssa commented Aug 6, 2024

This is a draft PR that adds support for creating and updating backends with the different keepalive parameters:

  • keepalive_time, which is how long HTTP keepalive connections will be kept when they are idle; I've made the flag for this --http-ka-time to make it easier to differentiate with the --tcp-ka-* flags.
  • tcp_keepalive_enable, which determines whether TCP keepalives are turned on on connections.
  • tcp_keepalive_interval which determines how long to wait in between sending each TCP keepalive probe.
  • tcp_keepalive_probes which determines up to how many probes to send before considering the connection dead.
  • tcp_keepalive_time which determines how long to wait after sending the last data packet before starting to send TCP keepalive probes.

@ulyssa ulyssa force-pushed the ulyssa/tcp-ka branch 2 times, most recently from d48cdd9 to b1ef3a5 Compare August 6, 2024 16:50
@ulyssa ulyssa marked this pull request as ready for review August 6, 2024 16:53
@ulyssa
Copy link
Contributor Author

ulyssa commented Aug 6, 2024

This will depend on pulling in fastly/go-fastly#537 once it has a tag we can put in go.mod.

@Integralist
Copy link
Collaborator

@kpfleming this PR requires a new go-fastly release that contains fastly/go-fastly#537

@kpfleming
Copy link
Contributor

This will need tests added in backend_test.go as well.

@ulyssa
Copy link
Contributor Author

ulyssa commented Aug 7, 2024

I added tests in f1fda72, which helped me realized that I missed accounting for the new fields in describe/list, which I've now done in 62f5074.

@Integralist
Copy link
Collaborator

The build is failing...

Error: pkg/text/backend.go:41:7: b.TCPKeepAliveEnable undefined (type *fastly.Backend has no field or method TCPKeepAliveEnable)
Error: pkg/text/backend.go:44:68: b.TCPKeepAliveEnable undefined (type *fastly.Backend has no field or method TCPKeepAliveEnable)
Error: pkg/text/backend.go:46:68: b.TCPKeepAliveIntvl undefined (type *fastly.Backend has no field or method TCPKeepAliveIntvl)
Error: pkg/text/backend.go:47:66: b.TCPKeepAliveProbes undefined (type *fastly.Backend has no field or method TCPKeepAliveProbes)
Error: pkg/text/backend.go:48:67: b.TCPKeepAliveTime undefined (type *fastly.Backend has no field or method TCPKeepAliveTime)

@kpfleming
Copy link
Contributor

The build is failing...

Error: pkg/text/backend.go:41:7: b.TCPKeepAliveEnable undefined (type *fastly.Backend has no field or method TCPKeepAliveEnable)
Error: pkg/text/backend.go:44:68: b.TCPKeepAliveEnable undefined (type *fastly.Backend has no field or method TCPKeepAliveEnable)
Error: pkg/text/backend.go:46:68: b.TCPKeepAliveIntvl undefined (type *fastly.Backend has no field or method TCPKeepAliveIntvl)
Error: pkg/text/backend.go:47:66: b.TCPKeepAliveProbes undefined (type *fastly.Backend has no field or method TCPKeepAliveProbes)
Error: pkg/text/backend.go:48:67: b.TCPKeepAliveTime undefined (type *fastly.Backend has no field or method TCPKeepAliveTime)

I haven't made a go-fastly release yet, so unless someone else did this will continue. That's on my agenda for today if nobody else does it first.

@kpfleming
Copy link
Contributor

go-fastly 9.8.0 has been released.

Copy link
Contributor

@kpfleming kpfleming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very very close :-)

pkg/commands/backend/describe.go Outdated Show resolved Hide resolved
pkg/commands/backend/create.go Show resolved Hide resolved
pkg/commands/backend/update.go Show resolved Hide resolved
@kpfleming kpfleming merged commit a5b3e21 into fastly:main Aug 7, 2024
6 checks passed
@kpfleming kpfleming changed the title Support configuring connection keepalive parameters feat(backend): Support configuring connection keepalive parameters Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants