Closed SpComb closed 7 years ago
This is because the Kontena 1.2 MongoPubsub
stored the RPC payload as a BSON::Document
, which also normalize keys to strings, as in MessagePack
, but the resulting BSON::Document
from MongoPubsub#subscribe
also acts as a HashWithIndifferentAccess
, normalizing Symbol key lookups to Strings.
{ "_id" : ObjectId("592418009b0404a8b0cf4b73"), "channel" : "rpc_client", "data" : { "type" : "request", "id" : "5UNJ:XBVI:2MKI:EGDV:GY6L:J3KR:AWXR:BKRZ:XJS2:GPHN:7UVT:KPFD", "message" : [ 0, 565594856, "/etcd/health", [ ] ] }, "created_at" : ISODate("2017-05-23T11:07:44.513Z") }
{ "_id" : ObjectId("592418009b0404a8b0cf4b74"), "channel" : "rpc_client:565594856", "data" : { "message" : [ 1, 565594856, null, { "health" : true } ] }, "created_at" : ISODate("2017-05-23T11:07:44.773Z") }
api_1 | D, [2017-05-23T11:13:50.304796 #12] DEBUG -- V1::NodesApi: etcd_health={"health"=>true} class=BSON::Document @etcd_health[:health]=true
The
/v1/nodes/:grid/:node/health
API's{"etcd_health": ...}
field is broken, and always returnsnull
, causing the CLI to consider the node as unhealthy:This seems to be because the JSON view uses symbol keys:
But the RPC response has string keys after passing through
MessagePack
, both on the websocket andMongoPubsub
layers:The agent sends the RPC response with symbol keys: