Fix a threading-related crash in privacy consent recalculation.

Review Request #13322 — Created Oct. 9, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

Under certain conditions, we recompute the privacy consent
registrations. This can happen on thread startup or teardown, and
occasionally, two threads end up interfering with each other's state.

This happens because, when recomputing, an unregister is performed, and
on a blank registry this will trigger a registry population, which then
triggers a signal and another attempt at a recomputation, in the middle
of an existing one. If this happens in multiple threads, it compounds
the problem.

When this happens, we can end up triggering a double register of the new
consent requirements, which will crash.

We now surround all this with a threading lock, and check for this in
the signal handler to avoid triggering an extra recomputation.

Unit tests pass.

Consent requirements continue to work properly.

Commits

Files

    Loading...