Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Set timeout for parse request #78

Closed
smacker opened this issue Feb 13, 2019 · 4 comments
Closed

Set timeout for parse request #78

smacker opened this issue Feb 13, 2019 · 4 comments
Assignees

Comments

@smacker
Copy link
Contributor

smacker commented Feb 13, 2019

I'm running analyzis on many files some of them are big.
I see quite many

rpc error: code = DeadlineExceeded desc = context deadline exceeded

errors.

I would prefer to process slower but avoid these errors.

Timeout future similar to client-go could help here.

@bzz
Copy link
Contributor

bzz commented Feb 14, 2019

Different gRPC clients have different approaches for handling timing issues, as noted in official doc.

Java client, that Scala uses underneath, has only a concept of Deadlines and does not have Timeouts (the difference is well explained in grpc/grpc-java#1495 (comment)).

Current impl of the scala-client use the defaults from io/grpc/CallOptions.java#L44 which AFAIK do not set any deadline for each request.

So the simplest thing we could do here is to expose such Deadlines (a fixed point in time) as an optional argument of BblfshClient constructor, along with host, port, etc. which does not seem to be that useful. Best possible effort would be to expose the Deadline at Parse() API call, so it can be set per-call, rather then per-client.

Let me know if that would help.

I would prefer to process slower but avoid these errors.

From the analysis of the batch processing logs discussed elsewhere, it seems that the Deadline solution might not help as a solution, as the problem might be in bblfshd server when under a heavy load.

But please, let me know if there any particular files that reproduce the deadline exception.

@smacker
Copy link
Contributor Author

smacker commented Feb 14, 2019

Deadline in Parse() sounds good. Let me come back to it a little bit later.
I'll try to come up with some test case that we can use to reproduce the issue and validate the fix.

@bzz
Copy link
Contributor

bzz commented Feb 14, 2019

All the information above is related to grpc timeout/deadline which will only be working after a migration to v2 protocol, that is currently "on hold" in #76.

For the v1 that Scala client uses right now, we expose a ParseRequest.timeout in Protobuf on API level, and it will be set to 5 seconds by default.

In this issue I'm going to make it configurable by the client in v1. This should reach the desired effect for current state of affairs.

@smacker
Copy link
Contributor Author

smacker commented Feb 15, 2019

Test case:

$ git clone https://github.com/smacker/client-scala
$ cd client-scala
$ git checkout timeout_error

smacker in ~/Work/client-scala on timeout_error [?]
$ ./sbt "test-only *BblfshClientTimeoutTest"
[info] BblfshClientTimeoutTest:
[info] - Parse timeout requests *** FAILED ***
[info]   Vector("rpc error: code = DeadlineExceeded desc = context deadline exceeded") was not empty (BblfshClientTimeoutTest.scala:21)

bzz added a commit to bzz/client-scala that referenced this issue Feb 15, 2019
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz bzz closed this as completed in #79 Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants