hashicorp / hashicorp/serf

serf query uses up all the time up to -timeout, even when not necessary

Open
#509 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
6.1k
Forks
609
Avg merge
15h 1m
Merged PRs (30d)
3

Description

This seems to be a bug, unless I misunderstand the meaning of timeout:
- I send a query to a 2-node cluster.
- The response comes back immediately.
- However, serf agent keeps waiting up until -timeout expires (default seems to be 3s).
- What is it waiting for?
It knows there are 2 nodes in the cluster.
It knows that it received the response from both..should be time to exit now.
- Please check these two runs:

Thank you!

``
> time serf query -no-ack **-timeout=0.2s** load mypayload
Query 'load' dispatched
Response from 'host1': 16:53:23 up 28 days, 23:49, 6 users, load average: 0.04, 0.04, 0.00
Response from 'host2': 16:53:23 up 133 days, 13:05, 8 users, load average: 0.45, 0.65, 0.66
Total Responses: 2
real 0m**0.231s**

> time serf query -no-ack **-timeout=10s** load mypayload
Query 'load' dispatched
Response from 'host1': 16:53:33 up 28 days, 23:50, 6 users, load average: 0.03, 0.04, 0.00
Response from 'host2': 16:53:33 up 133 days, 13:05, 8 users, load average: 0.45, 0.64, 0.66
Total Responses: 2
real 0m**10.032s**

``

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.