Open TheRealMal opened 1 month ago
file is being opened here https://github.com/etcd-io/etcd/blob/9914047acb5c679531f644d9c81718fcd85a3108/client/v3/snapshot/v3_snapshot.go#L63
but being closed only here https://github.com/etcd-io/etcd/blob/9914047acb5c679531f644d9c81718fcd85a3108/client/v3/snapshot/v3_snapshot.go#L87
Between these lines errors can be occured and file won't be closed
There should close function invocation via defer
Check code
-
latest
Thanks for raising this. Please feel free to deliver a PR, thx
@ahrtr @TheRealMal https://github.com/etcd-io/etcd/pull/18200 - does this make sense?
Bug report criteria
What happened?
file is being opened here https://github.com/etcd-io/etcd/blob/9914047acb5c679531f644d9c81718fcd85a3108/client/v3/snapshot/v3_snapshot.go#L63
but being closed only here https://github.com/etcd-io/etcd/blob/9914047acb5c679531f644d9c81718fcd85a3108/client/v3/snapshot/v3_snapshot.go#L87
Between these lines errors can be occured and file won't be closed
What did you expect to happen?
There should close function invocation via defer
How can we reproduce it (as minimally and precisely as possible)?
Check code
Anything else we need to know?
-
Etcd version (please run commands below)
latest
Etcd configuration (command line flags or environment variables)
-
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
-
Relevant log output