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 locking in select_connector of AuthHandler #833

Merged
merged 4 commits into from
Aug 16, 2024
Merged

Conversation

Pietfried
Copy link
Contributor

@Pietfried Pietfried commented Aug 14, 2024

Describe your changes

Locking in select_connector

This PR covers #831 . It fixes the mutex locking when selecting a connector for an authorization request for the SelectionAlgorithm::PlugEvents. This could cause the get_latest_plugin to return the same connector for two different authorization requests.

With these changes every connector referenced by an authorization request is locked until this authorization request is processed (which means handle_token returns).

Locking in reservation manager

This PR also adds locking reservations map of the reservation manager to make it thread safe.

Fix test cases

This PR #832 commented out test cases that were sporadically failing in the CI. With this PR they are reactivated, since the changes described above fix the issue. In addition, the auth_tests have been updated by removing all unnecessary std::chrono::sleep_for and by making sure that the order of events meet the test cases expectations.

Issue ticket number and link

#831

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@Pietfried Pietfried force-pushed the fix/auth-test-cases branch from dc9b41a to 89aeac6 Compare August 14, 2024 21:23
@Pietfried Pietfried linked an issue Aug 15, 2024 that may be closed by this pull request
@Pietfried Pietfried marked this pull request as ready for review August 15, 2024 09:19
@Pietfried Pietfried merged commit bc84187 into main Aug 16, 2024
11 checks passed
@Pietfried Pietfried deleted the fix/auth-test-cases branch August 16, 2024 16:30
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.

Investigate / Refactor Auth module thread handling
2 participants