-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: support keepalive and deadline configuration for grpc sink #19
Conversation
src/main/java/com/gotocompany/firehose/sink/grpc/client/GrpcClient.java
Outdated
Show resolved
Hide resolved
|
||
return dynamicMessage; | ||
protected CallOptions decorateCallOptions(CallOptions defaultCallOption) { |
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.
protected CallOptions decorateCallOptions() {
CallOptions defaultCallOption = CallOptions.DEFAULT;
if (grpcSinkConfig.getSinkGrpcArgDeadlineMS() != null && grpcSinkConfig.getSinkGrpcArgDeadlineMS() > 0) {
return defaultCallOption.withDeadlineAfter(grpcSinkConfig.getSinkGrpcArgDeadlineMS(), TimeUnit.MILLISECONDS);
}
return defaultCallOption;
}
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.
This needs to be checked.. let's think about a default value.
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.
Default grpc client don't set any default value. Not sure what would be right default value for us. I would prefer not to have any default value for deadline.
src/main/java/com/gotocompany/firehose/sink/grpc/client/GrpcClient.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gotocompany/firehose/sink/grpc/client/GrpcClient.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gotocompany/firehose/config/GrpcSinkConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gotocompany/firehose/config/GrpcSinkConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gotocompany/firehose/sink/grpc/GrpcSinkFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gotocompany/firehose/sink/grpc/client/GrpcClient.java
Outdated
Show resolved
Hide resolved
src/main/java/com/gotocompany/firehose/sink/grpc/GrpcSinkFactory.java
Outdated
Show resolved
Hide resolved
@lavkesh - Can we merge this PR? |
8d30798
to
f3cb6b2
Compare
Hey, I just made a Pull Request!
Adding capabilities to set deadlines, keepalive_time, and keepalive_timeout for grpc sink.
keepalive_time and keepalive_timeout helps early identify half-open connection.
Linux by default has a mechanism to detect less-clean failure (half-open connection) with net.ipv4.tcp_retries2. This has a default value of 15. Only when that number is reached, the OS will forcefully terminate the “half-open” connection and force the connection to be recreated.
Deadlines allow gRPC clients to specify how long they are willing to wait for an RPC to complete before the RPC is terminated with the error DEADLINE_EXCEEDED. If you don’t set a deadline, resources will be held for all in-flight requests, and all requests can potentially reach the maximum timeout. Which would increase the latency of the service.