session.RenewPeriodic description is unclean
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Overview of the Issue
https://github.com/hashicorp/consul/blob/87f6617eecd23a64add1e79eb3cd8dc3da9e649e/api/session.go#L164
Description of RenewPeriodic says that it is renewing a long-running session. But it is incorrect because it is also DESTROY session if doneCh is closed. It leads to a lot of confusion if you assume to reuse the session later.
https://github.com/hashicorp/consul/blob/87f6617eecd23a64add1e79eb3cd8dc3da9e649e/api/session.go#L201
#### Reproduction Steps
For example, we have multiple go routines running RenewPeriodic that following each other. I expect that the last routine will keep the session until TTL expired. If the session is required, then we renew the session ID. If not, then Consul will delete all resources after a while.
### Consul info
```
build:
prerelease =
revision = ca5c3894
version = 1.9.1
```
### Proposal
Is it possible to fix Golang description or add a boolean flag indicating whether Consul should delete the session or not?
Contributor guide
Assessment
This issue has not been assessed yet.