fix: Make Java gRPC client use timeouts as expected by acevedosharp · Pull Request #4237 · feast-dev/feast
What this PR does / why we need it:
In my previous PR I added deadlines to the gRPC stub used in Java FeastClient, however deadlines in gRPC don't behave like timeouts and in that PR are only set once when the client is constructed, causing requests after construction to fail with deadline exceeded even though the time they took was was within the deadline the used thought they had set up; here's an example of the issue:
// Create the client, deadline starts counting from the moment client is instantiated FeastClient client = new FeastClient(channel, Optional.empty(), Optional.of(Deadline.after(200, TimeUnit.MILLISECONDS))); Thread.sleep(200); client.getOnlineFeatures(...); // throws a StatusRuntimeException: DEADLINE_EXCEEDED
The getOnlineFeatures(...) call would exceed the deadline even if it took 1ms.
The official gRPC examples show the correct usage for adding timeouts is to create a copy stub with a new deadline setup for every new request as shown here, which is what is included in this PR.
Which issue(s) this PR fixes:
N/A
Fixes
N/A