Correct method to detect if node is online or offline

37 views
Skip to first unread message

Gregorio Di Stefano

unread,
Jun 15, 2020, 7:17:57 AM6/15/20
to Consul
Hi, 

Another question regarding the correct method to determine if a node is alive or not:
We rely on the member API to determine that status of nodes, but, find it weird that that status codes for member status are enum type without any constants set in the Go library. 

The only way to find out what these actual int values mean is by looking at the product source code: https://github.com/hashicorp/consul/blob/v0.6.4/vendor/github.com/hashicorp/serf/serf/serf.go#L148 to determine what they actually mean.
This give me the impression we are doing something incorrectly.

Thanks

schri...@hashicorp.com

unread,
Jun 15, 2020, 5:18:32 PM6/15/20
to Consul
Howdy again Greg,
Those integers being returned aren't super clear. I went ahead and opened up this PR to be able to provide more clarification. 
We cannot replace the status integers being returned because any change like that would be considered a breaking change and would not be backwards compatible. I hope this helps, though.

- Sarah

Reply all
Reply to author
Forward
0 new messages