Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional logging. Remove unnecessary router lookups. May addres… #1483

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

plorenz
Copy link
Member

@plorenz plorenz commented Oct 31, 2023

…s #1460

@plorenz plorenz requested review from a team as code owners October 31, 2023 14:05
return err
}
if r == nil {
return errors.Errorf("no router with id [%v] found, closing connection", ch.Id())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"closing connection" is not actually happening here and is misleading imo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to 'not accepting' so it's more accurate.

if err := binding.Bind(newBindHandler(self.heartbeatOptions, r, self.network, self.xctrls)); err != nil {
return errors.Wrap(err, "error binding router")
r.Listeners = nil
if val, found := ch.Underlay().Headers()[int32(ctrl_pb.ContentType_ListenersHeader)]; found {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i assume you know that ctrl_pb.ContentType_ListenersHeader is always gonna be 4 bytes long so this is 'fine'.... just leaving that comment to point it out. if that's fine, cool...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i also see now that is how it always was, originally i thought tihs was new code so... nevermind prolly)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctrl_pb.ContentType_ListenersHeader is a ContentType which is an alias for an int32, so the cast is fine.

}
}
} else {
log.Info("no advertised listeners")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really an info type of message?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was Warn and I dropped it to Info. Dropped it further to Debug.

}

log.Info("accepted new router connection")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why lose the existing, presumably useful, r.Id? is the [r/Id] not useful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a logger field for routerId added at the top, so this was redundant.

Copy link
Member

@dovholuknf dovholuknf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing looks like it shoudl stop the pr, just some questions here/there

@plorenz plorenz merged commit 63cb63f into release-next Oct 31, 2023
@plorenz plorenz deleted the instant-sync-tidy branch October 31, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants