-
Notifications
You must be signed in to change notification settings - Fork 586
ApiListener#RelayMessageOne(): log🪵 to which Endpoint messages are relayed #10393
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
Open
Al2Klimov
wants to merge
1
commit into
master
Choose a base branch
from
zone-endpoint-log
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that if condition is triggered, the endpoint is going to be skipped, so why log here something that says otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the parent endpoint targetEndpoint is skipped. But the node is still "Relaying messages for parent Zone" via currentZoneMaster which I clearly say here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's far from clear, there's not even a single comment that explains it. We've spent literally hours discussing this in person, so I don't know what else you want me to say. So, since this PR is based on @lippserd's request from #10389 (review), I'll describe 1 what it does for you and see if that's what you asked for, but to me it clearly doesn't reflect what the actual code does.
Footnotes
Suppose you have two endpoints (S1 and S2) in a
satellite
HA zone, and amaster
zone with endpoints (M1 and M2) as parents. In such a HA setup, only one of the endpoints from either zone is allowed to communicate with the respective parent/child zone at a time. Now let's say thatM1
andS1
are responsible for message exchange between these zones, i.e. onlyS1
is responsible for forwarding the messages to the parent (master) zone andM1
is responsible for accepting them and sending back other messages from/to thesatellite
zone. So each timeS2
wants to send messages toM1
andM2
endpoints (it's target zone being set to themaster
zone) it will trigger this if condition and with this PR it would also log something like...Relaying messages for parent zone 'master' to endpoint 'S1'
even though it's skipping the endpoints (M1
andM2
). Well, hopefully messages intended for the parent zone will be sent to the partner endpoint (S1) at some point, but whether and when they will be sent as this log claims is not known at all, because this log is based on the assumption that when this condition is triggered, the message might even have been sent already or will possibly be sent toS1
. ↩There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, yes.
But, to my defense, there's the log message itself using names from clearly named distinct variables.
It absolutely reflects it! Please see my test in OP and/or, at your option, run own tests with M1/M2/S1/S2. Shut down any combination of nodes and I forecast you: the actual log message will be correct.
I'm aware it's not 100% perfect. But I need you to understand there's only one ApiListener#RelayMessageOne() call per message if latter is intended for the parent zone. So (if I don't wanna hope in that one function call whether another one will/has happen(ed),) I have to use the opportunity of this one call while inside. And luckily I have everything I need! I know for sure whether the message is for the parent zone and whether it's send directly (log message 2) or indirectly (log message 1). It's just fine and, as requested, I log every time the routing changes from logger PoV.