-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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.
Looks good to me.
Not sure if this should be INFO or DEBUG though.
src/service/network.toit
Outdated
if connection.is-quarantined: | ||
remaining-us := connection.quarantined-until_ - Time.monotonic-us | ||
remaining-duration := Duration --us=remaining-us | ||
logger_.info "skipping quarantined" --tags={ |
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.
I prefer having a shared prefix for these messages, so maybe something like this:
logger_.info "skipping quarantined" --tags={ | |
logger_.info "quarantined - skipped" --tags={ |
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.
done.
src/service/network.toit
Outdated
@@ -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} |
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.
Maybe the remaining/duration could be the same key? They mean the same thing.
logger_.info "quarantining" --tags={"connection": name, "duration": QUARANTINE-NO-DATA} | |
logger_.info "quarantined" --tags={"connection": name, "duration": QUARANTINE-NO-DATA} |
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.
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} |
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.
Either call this before or after calling connection.quarantine
consistently.
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.
done.
No description provided.