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

Close session in worker_webhook function #1456

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

kkaarreell
Copy link
Contributor

Resolves #1455

@kkaarreell
Copy link
Contributor Author

There is a Packit service outage and therefore Packit tests have not been started yet.

@kkaarreell
Copy link
Contributor Author

/packit test

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #1456 (47b7d0c) into master (fc5cc69) will decrease coverage by 0.02%.
Report is 1 commits behind head on master.
The diff coverage is 91.66%.

Additional details and impacted files
Flag Coverage Δ
packit-e2e 72.15% <91.66%> (-0.03%) ⬇️
testsuite 29.87% <0.00%> (ø)
unittests 7.64% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
keylime/revocation_notifier.py 35.24% <91.66%> (ø)

... and 1 file with indirect coverage changes

@@ -159,6 +159,8 @@ def worker_webhook(tosend: Dict[str, Any], url: str) -> None:

time.sleep(next_retry)

session.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that a bit more correct fix is to use the context manager: https://requests.readthedocs.io/en/latest/user/advanced/#session-objects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@kkaarreell kkaarreell changed the title Add session.close() to worker_webhook function Close session in worker_webhook function Aug 15, 2023
Resolves keylime#1455

Signed-off-by: Karel Srot <ksrot@redhat.com>
Signed-off-by: Karel Srot <ksrot@redhat.com>
@kkaarreell
Copy link
Contributor Author

I have just merged two commits.

@THS-on THS-on merged commit 22f0656 into keylime:master Aug 18, 2023
14 checks passed
@kkaarreell kkaarreell deleted the ks_issue1455 branch August 18, 2023 14:25
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.

webhook worker doesn't close opened session correctly
5 participants