Skip to content

Wire up sent nonces#31

Merged
PapaCharlie merged 1 commit intomasterfrom
pc/acks
Sep 13, 2025
Merged

Wire up sent nonces#31
PapaCharlie merged 1 commit intomasterfrom
pc/acks

Conversation

@PapaCharlie
Copy link
Copy Markdown
Member

By adding new, more granular server event types, event handlers now have much more visibility into what the server is doing. Specifically, it can now track pending nonces and in-flight requests. Similarly, because the RequestReceived fires when the request is received and RequestProcessed fires when the request is processed, the two events can be used to track whether the ResourceLocator is hanging.

By adding new, more granular server event types, event handlers now have much
more visibility into what the server is doing. Specifically, it can now track
pending nonces and in-flight requests. Similarly, because the `RequestReceived`
fires when the request is received and `RequestProcessed` fires when the request
is *processed*, the two events can be used to track whether the ResourceLocator
is hanging.
Comment on lines +30 to +32
// If the request is an ACK or a NACK, it will include a nonce, which should correspond to a nonce
// listed in a previously emitted [ResponseSent] event.
Nonce string
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

so, do we plan to detect ResponseSent events that have no ACK/NACK received after a while? which seems to be a straightforward metric to show client side issues.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, exactly. You will see what this looks like when it's implemented in the observer

Comment thread server_test.go
Comment on lines +44 to +47
NACKsReceived atomic.Int64
ACKsReceived atomic.Int64
RequestsReceived atomic.Int64
RequestsProcessed atomic.Int64
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

try to understand the current expectation, is it right to expect that in every min, the RequestsReceived = RequestsProcessed = ACKsReceived + NACKsReceived?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not quite as not all requests are ACK/NACK, they could be new resource subscriptions.

It's more like len(Nonces) == NACKsReceived + ACKsReceived. For sure the state should eventually converge to RequestsReceived == RequestsProcessed. Finally, RequestsReceived >= NACKsReceived + ACKsReceived

@PapaCharlie PapaCharlie merged commit 831a2c3 into master Sep 13, 2025
2 checks passed
@PapaCharlie PapaCharlie deleted the pc/acks branch September 13, 2025 00:13
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