
csrfr
Distributed Services with Go: accessing the service outside the pods (Beta-4 pg.223)
Once deployed, I am not able to access the service outside the prolog pods. I can run the client successfully and access the service from a client running on one of the proglog pods.
However, I am not able to access the service from the following locations:
-
Laptop: The client connection hangs and then returns
connection error while dialing dial tcp: lookup proglog-0.proglog.mysvcs.svc.cluster.local: no such host.
I am dialing using the EXTERNAL-IP address of proglog-0 from k8s in the client (This address works when used from a proglog pod). -
From a pod in the k8s cluster but not a proglog pod. It prints the following error repeatedly
ERROR: 2020/10/31 18:59:29 [core] subconn returned from pick is not *acBalancerWrapper
. Also, the acBalancerWrapper error appears when running the client from a proglog pod (where it usually works) from time to time.
Anyone faced this before, ideas?
At the moment I’m looking into GetServers
returning the K8s DNS names (e.g. proglog-0.proglog.default.svc.cluster.local:8400
rather than the EXTERNAL-IP of the pods.
Marked As Solved

travisjeffery
Yeah we should return ErrNoSubConnAvailable like so:
func (p *Picker) Pick(info balancer.PickInfo) (
balancer.PickResult, error) {
p.mu.RLock()
defer p.mu.RUnlock()
var result balancer.PickResult
if strings.Contains(info.FullMethodName, "Produce") ||
len(p.followers) == 0 {
result.SubConn = p.leader
} else if strings.Contains(info.FullMethodName, "Consume") {
result.SubConn = p.nextFollower()
}
if result.SubConn == nil {
return result, balancer.ErrNoSubConnAvailable
}
return result, nil
}
so gRPC will block the RPC until a new picker is available with available sub connections.
Popular Prag Prog topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /django
- /security
- /nodejs
- /centos
- /rails
- /haskell
- /fable
- /gleam
- /js
- /swift
- /deno
- /tailwind
- /assemblyscript
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /preact
- /flutter
- /c-plus-plus
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /keyboards
- /html
- /vuejs
- /nim
- /emacs
- /elm
- /nerves