Event Stream:The channel is dead-looped to write invalid data, causing the listener to also dead-loop

When using Nomad event stream, I encountered a problem with the event channel being written to non-json format data like crazy .for { select { case <-ctx.Done(): return case <-m.stopCh: level.Info(logger).Log("message", "Global stop trigger Stop stream subscription") return case event := <-eventCh: if event.Err != nil { level.Warn(logger).Log("message", "Error from event stream", "error", event.Err) break }
The error behavior you get is that the warn log will always be printed out.
My guess is that this is a problem with the nomad rpc server when organizing data in json format, resulting in invalid character ‘s’ looking for the beginning of value. A normal json format should start with ‘{’. @jrasell

@jrasell This problem is causing a very big potential problem for my program. Please help me.

Hi @wangyuanhang111

I’m really sorry to hear you are having problems. Do you have a repo or reproduction steps you can share? For something like this a repo would be great, so that we can look at the problem and know we’re recreating it correctly.

  • Derek and the Nomad Team