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

Fix logging for HostGA plugin retry logic #1655

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

pgombar
Copy link
Contributor

@pgombar pgombar commented Oct 4, 2019

Description

  • Change info to periodic, otherwise it will show up every 3 seconds.

  • Remove successful log message since it's too frequent and we don't usually log successes, only failures.

Issue #1653


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines


This change is Reviewable

@codecov
Copy link

codecov bot commented Oct 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (release-2.2.43@6403d33). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                @@
##             release-2.2.43    #1655   +/-   ##
=================================================
  Coverage                  ?   66.58%           
=================================================
  Files                     ?       80           
  Lines                     ?    11198           
  Branches                  ?     1571           
=================================================
  Hits                      ?     7456           
  Misses                    ?     3412           
  Partials                  ?      330
Impacted Files Coverage Δ
azurelinuxagent/common/protocol/wire.py 75.43% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6403d33...f0a29c6. Read the comment docs.

@@ -1080,7 +1080,6 @@ def send_request_using_appropriate_channel(self, direct_func, host_func):
log_event=False)
raise

logger.info("Request succeeded using the host plugin channel.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this verbose maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but seeing that our approach for everything else is to log only in case of failures, it didn't make sense to keep it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The restutil class actually already reports HTTP response codes to the verbose log:

2019/10/03 14:19:03.577846 INFO ExtHandler Using host plugin as default channel
2019/10/03 14:19:03.577928 VERBOSE ExtHandler Fetch [http://168.63.129.16:32526/extensionArtifact] with headers [{'x-ms-containerid': u'7046131f-09e6-49a7-94d0-046fecde7b31', 'x-ms-version': '2015-09-01', 'x-ms-host-config-name': u'2168188a-b556-4cbe-bd34-0c2ee61b05c9.0.2168188a-b556-4cbe-bd34-0c2ee61b05c9.0._Publisher-8.1.0.195.1.xml', 'x-ms-artifact-location': u'https://md-rbpdn51z1wb2.blob.core.windows.net/$system/Publisher-8.1.0.195.4c6f8a03-61a5-49b8-ad66-b2aeb63ad93f.vmSettings?sv=2017-04-17&sr=b&sk=system-1&sig=K%2bbjPdHEKIq8oZ6U6tzbW2S4UxSgnD3g0s6uunZ865Q%3d&se=9999-01-01T00%3a00%3a00Z&sp=r'}]
2019/10/03 14:19:03.578215 VERBOSE ExtHandler HTTP connection [GET] [/extensionArtifact] [None] [{'x-ms-containerid': u'7046131f-09e6-49a7-94d0-046fecde7b31', 'x-ms-version': '2015-09-01', 'x-ms-host-config-name': u'2168188a-b556-4cbe-bd34-0c2ee61b05c9.0.2168188a-b556-4cbe-bd34-0c2ee61b05c9.0._Publisher-8.1.0.195.1.xml', 'x-ms-artifact-location': u'https://md-rbpdn51z1wb2.blob.core.windows.net/$system/Publisher-8.1.0.195.4c6f8a03-61a5-49b8-ad66-b2aeb63ad93f.vmSettings?sv=2017-04-17&sr=b&sk=system-1&sig=K%2bbjPdHEKIq8oZ6U6tzbW2S4UxSgnD3g0s6uunZ865Q%3d&se=9999-01-01T00%3a00%3a00Z&sp=r', 'User-Agent': 'WALinuxAgent/2.2.43', 'Connection': 'close'}]
2019/10/03 14:19:03.589926 VERBOSE ExtHandler [HTTP Response] Status Code 200
2019/10/03 14:19:03.590171 INFO ExtHandler Request succeeded using the host plugin channel.

Since we already have [HTTP Response] Status Code 200 the next message is unnecessary.

Copy link
Contributor

@larohra larohra left a comment

Choose a reason for hiding this comment

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

Minor comment else LGTM

@pgombar pgombar merged commit c6eeffb into Azure:release-2.2.43 Oct 4, 2019
@pgombar pgombar deleted the fix_logging branch October 4, 2019 22:41
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.

4 participants