Filestream registry ttl set to `-1000000000`
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 364
Description
Filestream can save registries entries with `ttl: -1000000000`:
```json
{
"k": "filestream::filestream-filestream.filestream-b2ba3e04-b563-491d-b656-bc4737ab2940::fingerprint::bb2b900c6496ba613b53fde04fe3dc705ebe539098c7d74fab9d195714b07543",
"v": {
"cursor": {
"eof": false,
"offset": 267075
},
"meta": {
"fingerprint_len": 0,
"identifier_name": "fingerprint",
"source": "/tmp/flog.log"
},
"ttl": -1000000000,
"updated": [
280444948188057,
1788381042
]
}
}
```
While odd, this does not change the behaviour of disabling the entry clean up because the code checks if `ttl <= 0`.
This happens because `clean_inactive` is parsed as a time.Duration by go-ucfg, which treats the YAML `-1` (default we use in the Filestream integration) as `-1s` and when this gets parsed as nanosecond it becomes `-1000000000`.
At the moment this parsing behaviour does not cause any problem, this issue exists to document this odd behaviour.
Contributor guide
Research direction
Start with the Filestream integration's clean_inactive setting and the go-ucfg duration parsing described in the issue. Check the existing cleanup condition that treats ttl <= 0 as disabled and confirm the registry representation; done means the documented behavior and its lack of impact are accurately recorded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100