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 more quarantine log information. #950

Merged
merged 2 commits into from
Feb 6, 2024
Merged

Add more quarantine log information. #950

merged 2 commits into from
Feb 6, 2024

Conversation

floitsch
Copy link
Member

@floitsch floitsch commented Feb 6, 2024

No description provided.

@floitsch floitsch requested a review from kasperl February 6, 2024 08:43
Copy link
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Not sure if this should be INFO or DEBUG though.

if connection.is-quarantined:
remaining-us := connection.quarantined-until_ - Time.monotonic-us
remaining-duration := Duration --us=remaining-us
logger_.info "skipping quarantined" --tags={
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer having a shared prefix for these messages, so maybe something like this:

Suggested change
logger_.info "skipping quarantined" --tags={
logger_.info "quarantined - skipped" --tags={

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@@ -47,18 +47,28 @@ class NetworkManager extends ProxyingNetworkServiceProvider:

quarantine name/string -> none:
connection/Connection? := connections_.get name
if connection: connection.quarantine QUARANTINE-NO-DATA
if connection:
logger_.info "quarantining" --tags={"connection": name, "duration": QUARANTINE-NO-DATA}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the remaining/duration could be the same key? They mean the same thing.

Suggested change
logger_.info "quarantining" --tags={"connection": name, "duration": QUARANTINE-NO-DATA}
logger_.info "quarantined" --tags={"connection": name, "duration": QUARANTINE-NO-DATA}

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

network/net.Client? := open-network_ connection
if network:
proxy-mask_ = network.proxy-mask
logger_.info "opened" --tags={"connection": network.name}
return network
connection.quarantine QUARANTINE-NO-NETWORK
logger_.info "quarantined" --tags={"connection": connection.name, "duration": QUARANTINE-NO-NETWORK}
Copy link
Contributor

Choose a reason for hiding this comment

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

Either call this before or after calling connection.quarantine consistently.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@kasperl kasperl merged commit e70d8e9 into main Feb 6, 2024
11 checks passed
@kasperl kasperl deleted the floitsch/network-logs branch February 6, 2024 10:43
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