[#242] pool: Log error that caused healthy status change #242
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-sdk-developers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#242
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-sdk-go:feature/log_unhealthy_error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
b9728d319b
to93ef8a4202
[#xxx] pool: Log error that caused healthy status changeto [#242] pool: Log error that caused healthy status change@ -376,2 +376,3 @@
// Return current healthy status and indicating if status was changed by this function call.
func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, changed bool) {
// Returns error that caused unhealthy status.
func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, changed bool, err error) {
What do you think about keeping signature of this method intact but adding logging of error (we know log and error here)?
Or at least consider drop
healthy bool
from return params. We can know this status from error.I would prefer the second option, because it's like in tree pool
93ef8a4202
toca7c2e0b8f
@ -2211,1 +2211,3 @@
zap.String("address", cli.address()), zap.Bool("healthy", healthy))
fields := []zap.Field{zap.String("address", cli.address()), zap.Bool("healthy", healthy)}
if err != nil {
fields = append(fields, zap.String("error", err.Error()))
zap.Error
formater instead stringifying the error :)"error"
fields seems unclear. It's optinally but I can suggest to log message likehealth was changed but client error occurred
iferr != nil
ЕМНИП We use
zap.String
becausezap.Error
produces unnecessary big stacktraces.For
error
I suggest replacing it with areason
, it is not an error related to the operation being logged (health status changed), it is the reason.ca7c2e0b8f
tofa89999d91