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

gRPC server connection option: MAX_CONNECTION_AGE #1636

Closed
sdual opened this issue Mar 7, 2019 · 5 comments
Closed

gRPC server connection option: MAX_CONNECTION_AGE #1636

sdual opened this issue Mar 7, 2019 · 5 comments
Milestone

Comments

@sdual
Copy link

sdual commented Mar 7, 2019

grpc-java provides an option MAX_CONNECTION_AGE to allow gRPC server to manage a duration of TCP connection. When a connection exceeds the MAX_CONNECTION_AGE, the server sends GOAWAY and terminates it.

Server server = NettyServerBuilder.forPort(port)
     .maxConnectionAge(MAX_CONNECTION_AGE, TimeUnit.MILLISECONDS)
     .addService(...)
     .build();

https://github.com/grpc/proposal/blob/master/A9-server-side-conn-mgt.md

Could armeria-grpc supoort this option?

@trustin
Copy link
Member

trustin commented Mar 7, 2019

Sounds like a good idea. I believe we could add more options related with server-side connection life cycle for all requests, not just gRPC.

FYI, there is currently only one knob for connection life cycle: idleTimeout which closes the connection if there is no request in progress for a certain amount of time.

@raidancampbell
Copy link

Adding my 2 cents here: We're running code in a restricted environment that kills long-lived TCP connections after a while to prevent resource leakage. The result is that the clients will try to use a TCP connection that was killed by some layer 4 infrastructure, and will fail.

Without this configuration, the client needs to implement retry logic: if this configuration were exposed, we could instead make a single server-side change to fix this.

@ikhoon
Copy link
Contributor

ikhoon commented Jun 11, 2021

I didn’t know we have this issue.
I believe we have already added this feature to Armeria since 0.99.7. #2747
https://javadoc.io/static/com.linecorp.armeria/armeria-javadoc/1.8.0/com/linecorp/armeria/server/ServerBuilder.html#maxConnectionAge(java.time.Duration)

@raidancampbell
Copy link

Ah, I was looking in the wrong section of the docs. I'll have to give it a try and see if it helps

@ikhoon
Copy link
Contributor

ikhoon commented Jun 11, 2021

Feel free to comment on this issue if it is not working as expected. 😀

@ikhoon ikhoon closed this as completed Jun 11, 2021
@ikhoon ikhoon added this to the 0.99.7 milestone Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants