Skip to content

Commit ac2bb80

Browse files
authored
Merge pull request #66 from smacker/mention_reset_backoff_for_golang
Mention caveat and fix for connections to data-server in golang
2 parents 7450de7 + 4f022a9 commit ac2bb80

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ When DataService is being dialed, you should:
3838
- turn off [gRPC fail-fast](https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md) mode if your analyzer creates a connection to DataServer before it was actually started. This way the RPCs are queued until the chanel is ready:
3939
- go: using `grpc.FailFast(false)`
4040
([example](https://github.com/src-d/lookout-gometalint-analyzer/blob/7b4b37fb3109299516fbb43017934d131784f49f/cmd/gometalint-analyzer/main.go#L66)).
41+
- golang: reset connection backoff to DataServer on event:
42+
if you keep the connection to DataServer open you need to reset the backoff when your analyzer receives a new event. Use the [`conn.ResetConnectBackoff`](https://godoc.org/google.golang.org/grpc#ClientConn.ResetConnectBackoff) method in your event handlers. It's needed to avoid broken connections after a `lookoutd` redeployment. In case of a long restart of `lookoutd` gRPC server, the backoff timeout may increase so much that the analyzer will not be able to reconnect before it makes the new request to DataServer.
4143

4244

4345
# Contributing

0 commit comments

Comments
 (0)