-
Notifications
You must be signed in to change notification settings - Fork 106
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
[bugfix] Improve handling of requests in httpjson logger #3354
Conversation
raise LoggingError( | ||
f'logging failed: HTTP response code ' | ||
f'{response.status_code}' | ||
) |
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.
Should Reframe crash in this case, or try to print a warning?
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.
How does the outpupt look like when we raise LoggingError
? I see that currently we do raise it, but I'm not sure it's the right thing. I would rather go for a warning instead (remember to include the name of the handler in the message).
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.
Consider also rebasing this PR onto master
.
raise LoggingError( | ||
f'logging failed: HTTP response code ' | ||
f'{response.status_code}' | ||
) |
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.
How does the outpupt look like when we raise LoggingError
? I see that currently we do raise it, but I'm not sure it's the right thing. I would rather go for a warning instead (remember to include the name of the handler in the message).
self._url, data=json_record, | ||
headers=self._headers | ||
) | ||
if response.status_code == 200: |
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 we should go for the more inclusive:
if response.status_code == 200: | |
if response.ok: |
break | ||
|
||
if response.status_code == 429: | ||
time.sleep(1) |
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.
Since this can slow down the pipeline what about spreading the wait with a cyclic interval list, say [.1, .2, .4, .8, 1.6, 3.2]
?
Fixes #3353 .