Skip to content

--watch-progress-notify-interval doesn't work through JSON config #20342

@Jille

Description

@Jille

Bug report criteria

What happened?

I got this error from etcd when setting "watch-progress-notify-interval": "1m", in a JSON config. I assume that passing it as a flag from the commandline does work.

[etcdmain/etcd.go:66] failed to verify flags
error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field configYAML.watch-progress-notify-interval of type time.Duration

I suspect this is because time.Duration doesn't have an UnmarshalJSON method, so there's nothing doing the duration parsing. It can be given as an integer, but then it's interpreted as nanoseconds.

Both watch-progress-notify-interval and experimental-watch-progress-notify-interval exhibit this behavior.

What did you expect to happen?

It to work the same as passing --watch-progress-notify-interval=1m.

How can we reproduce it (as minimally and precisely as possible)?

Add "experimental-watch-progress-notify-interval": "1m", to JSON.

Etcd version (please run commands below)

Details
etcd Version: 3.6.1
Git SHA: a4708be
Go Version: go1.23.10
Go OS/Arch: linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions