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

More comments in the signalling code #229

Merged
merged 13 commits into from
Jan 9, 2024

Conversation

RoxyFarhad
Copy link
Member

No description provided.

@RoxyFarhad RoxyFarhad changed the title Roxy comments Draft: Roxy comments Jan 3, 2024
@viambot viambot added the safe to test Mark as safe to test label Jan 3, 2024
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 3, 2024
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 4, 2024
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 5, 2024
@RoxyFarhad RoxyFarhad changed the title Draft: Roxy comments More comments in the signalling code Jan 5, 2024
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 5, 2024
Copy link
Member

@vijayvuyyuru vijayvuyyuru left a comment

Choose a reason for hiding this comment

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

These changes look good and will definitely help in the future if someone else starts looking in here. I can publish a new release after the metric change is merged in. Nice work!

@ohEmily
Copy link
Member

ohEmily commented Jan 8, 2024

[minor] could you add your name to your comments to follow Eric's convention? I know people can use git blame but sometimes these are harder to follow.

// Note(erd): 

@@ -422,14 +424,13 @@ func (queue *mongoDBWebRTCCallQueue) changeStreamManager() {
}
}()
var lastSeq uint64
var ranOnce bool
var ranOnce bool // this is only for the first time the changestream is setup
Copy link
Member

Choose a reason for hiding this comment

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

[minor] would it be worth renaming to initialized? or something else that documents that it only happens once.

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 isInitialized

@@ -597,15 +602,21 @@ func (queue *mongoDBWebRTCCallQueue) processNextSubscriptionEvent(next mongoutil
if _, ok := queue.csTrackingHosts[callResp.Host]; !ok {
// no one connected to this operator is currently subscribed to insert
// events for this host; skip
// we do this because each server is listening to an event and each host only lives on one server
// it could be on another server
return
Copy link
Member

Choose a reason for hiding this comment

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

would it be worth adding a debug log here or would it be so insanely noisy that it's 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.

i think it would be quite noisy and not useful

Copy link
Member

Choose a reason for hiding this comment

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

thanks!

@@ -614,10 +625,12 @@ func (queue *mongoDBWebRTCCallQueue) processNextSubscriptionEvent(next mongoutil
// though, we want to send the events as fast as possible as mentioned
// above and cannot block on the send to see if the receiver locked
// the document.
queue.logger.Infow("sending event", "event", event)
Copy link
Member

Choose a reason for hiding this comment

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

[q] wouldn't this log once per channel without including identifying information for the channel? Would it make sense to instead log the event in the log line above at line 619?

(Apologies if I'm misunderstanding here!)

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually just think we should remove this here, it will be noisy and it was mainly for me debugging locally :)

@RoxyFarhad RoxyFarhad requested a review from ohEmily January 9, 2024 16:22
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 9, 2024
@@ -0,0 +1,15 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

(maybe committed by accident?)

@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 9, 2024
Copy link
Member

@ohEmily ohEmily left a comment

Choose a reason for hiding this comment

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

LGTM! Wasn't sure exactly how you decided which comments to prefix with note(roxy) but it's a detail to add that; happy to defer to your decision tree. Thank you SO MUCH for marking this up and working to improve our signaling knowledge.

@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 9, 2024
@viambot viambot added safe to test Mark as safe to test and removed safe to test Mark as safe to test labels Jan 9, 2024
@RoxyFarhad RoxyFarhad requested a review from ohEmily January 9, 2024 17:22
@RoxyFarhad RoxyFarhad merged commit cb382ac into viamrobotics:main Jan 9, 2024
6 checks passed
@RoxyFarhad RoxyFarhad deleted the roxy-comments branch January 9, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Mark as safe to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants