Improve Lock Session LockDelay handling inc. lockDelayThreshold
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
We do some conversion to convert a lock delay of anything less than `1000ns` to seconds.
https://github.com/hashicorp/consul/blob/0c3db76c922f1e5458ec3b5ece01509fb37f17ab/agent/structs/structs.go#L2220-L2236
There's some more info on this here:
https://github.com/hashicorp/consul/blob/0c3db76c922f1e5458ec3b5ece01509fb37f17ab/agent/structs/structs.go#L155-L161
---
When using the API to create a new Lock Session with a `LockDelay` using a string of "5" as the `LockDelay` I get the following error:
`Request decode failed: time: missing unit in duration "5"`
Whereas a `5` as an integer is assumed to be seconds and `5000` is assumed nanoseconds.
Overall its a little confusing and I can't see any public documentation around this, so might be an idea to improve this or at least provide some API documentation detailing this.
cc @mkeeler
Contributor guide
Assessment
This issue has not been assessed yet.