ComplianceAsCode / auditree-framework

The Auditree framework tool to run compliance control checks as unit tests.
https://auditree.github.io/
Apache License 2.0
59 stars 23 forks source link

Fix `Locker.get_latest_commit` deadlock when running multiple threads. #136

Closed smithsz closed 2 years ago

smithsz commented 2 years ago

Overview

Iterating repository commits is not currently thread safe.

Requirements

Approach

Aquire the lock when iterating repository commits in Locker.get_latest_commit, i.e.

with self.lock:
    commit = next(self.repo.iter_commits(paths=path, **options))

Security and Privacy

No change.

Test Plan

Use the Cloudant compliance CI as a test bed for any proposed changes.