Agent sending unexpected response to the 'query' command
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 609
- Avg merge
- 15h 1m
- Merged PRs (30d)
- 3
Description
Sometimes the Serf agent seems to send an unexpected response via RPC containing `{From: "", Payload: null, Type: "response"}` to the 'query' command.
Debugging output from a client I'm working on ([0] and [1] indicate two different clients):
```
// [1] stream to listen for queries
serf [1] sending header: {"Command":"stream","Seq":11}
serf [1] sending body: {"Type":"query"}
serf [1] received {"Error":"","Seq":11}
// [0] issues query
serf [0] sending header: {"Command":"query","Seq":8}
serf [0] sending body: {"Name":"name","Payload":"payload"}
serf [0] received {"Error":"","Seq":8}
// [1] receives query
serf [1] received {"Error":"","Seq":11}
serf [1] received {"Event":"query","ID":1,"LTime":1,"Name":"name","Payload":{"type":"Buffer","data":[112,97,121,108,111,97,100]}}
// [1] sends response
serf [1] sending header: {"Command":"respond","Seq":13}
serf [1] sending body: {"ID":1,"Payload":"client two response"}
serf [1] received {"Error":"","Seq":13}
// [0] receives response
serf [0] received {"Error":"","Seq":8}
serf [0] received {"From":"agent-two","Payload":{"type":"Buffer","data":[99,108,105,101,110,116,32,116,119,111,32,114,101,115,112,111,110,115,101]},"Type":"response"} +0ms
// and then this !
serf [0] received {"Error":"","Seq":8}
serf [0] received {"From":"","Payload":null,"Type":"response"}
```
That's still followed by the expected `{From: "", Payload: null, Type: "done"}` response though:
```
// continued from above
// [0] receives 'done'
serf [0] received {"Error":"","Seq":8}
serf [0] received {"From":"","Payload":null,"Type":"done"}
```
I confirmed by packet sniffing that Serf is actually sending the `{From: "", Type: "response" Payload: null}` and that it's not a parsing error on our end. Here's a zip of the pcap file for the above dialog if you'd like (see frame 71 for the unexpected response): [streamcap.zip](https://github.com/hashicorp/serf/files/450612/streamcap.zip)
I haven't identified a pattern as to when this unexpected response is sent.
Version: 0.7.0
Contributor guide
Assessment
This issue has not been assessed yet.