hashicorp / hashicorp/serf

Serf leaves but client returns errors anyways

Open
#400 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

I am hitting an edge-case on the `centos:6` Docker container, when executing `serf leave -rpc-addr=127.0.0.1:7373` effectively triggers the `leave` event on the agent, but then the client returns with the following error:

```
Error leaving: client closed
```

Although the agent's logs properly confirm the graceful shutdown:

```
==> Starting Serf agent...
==> Starting Serf agent RPC...
==> Serf agent running!
Node name: 'f71dbac7f660'
Bind addr: '0.0.0.0:7946'
RPC addr: '127.0.0.1:7373'
Encrypted: false
Snapshot: false
Profile: lan

==> Log data will now stream in as it occurs:

2016/08/08 02:13:35 [INFO] agent: Serf agent starting
2016/08/08 02:13:35 [INFO] serf: EventMemberJoin: f71dbac7f660 172.17.0.2
2016/08/08 02:13:36 [INFO] agent: Received event: member-join
2016/08/08 02:13:41 [INFO] agent.ipc: Accepted client: 127.0.0.1:43884
2016/08/08 02:13:41 [INFO] agent.ipc: Graceful leave triggered
2016/08/08 02:13:41 [INFO] agent: requesting graceful leave from Serf
2016/08/08 02:13:41 [INFO] serf: EventMemberLeave: f71dbac7f660 172.17.0.2
2016/08/08 02:13:41 [INFO] agent: requesting serf shutdown
2016/08/08 02:13:41 [INFO] agent: shutdown complete
```

This can be replicated by starting the Serf agent like:

``` shell
serf agent > serf.log 2>&1 &
```

And then executing:

``` shell
serf leave -rpc-addr=127.0.0.1:7373
```

Sometimes it will work properly, but often the client will return the error.

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.