Fix deadlocks during search tests.

Review Request #12053 — Created Feb. 12, 2022 and submitted

Information

Review Board
release-5.0.x

Reviewers

Search tests which used on-the-fly indexing were hitting deadlocks under
the new haystack version. The problem here was that our indexing
templates were calling get_profile, which would end up creating new
profile objects if they didn't already exist. This would attempt to
write from inside the indexer stack, which would hit a lock.

I've added a new helper that can check if a profile is public without
creating ones that don't exist. Other related code has been updated to
use this new helper appropriately instead of reinventing the wheel.

Ran unit tests.

Summary ID
Fix deadlocks during search tests.
Search tests which used on-the-fly indexing were hitting deadlocks under the new haystack version. The problem here was that our indexing templates were calling `get_profile`, which would end up creating new profile objects if they didn't already exist. This would attempt to write from inside the indexer stack, which would hit a lock. I've added a new helper that can check if a profile is public without creating ones that don't exist. Other related code has been updated to use this new helper appropriately instead of reinventing the wheel. Testing Done: Ran unit tests.
29ea28602c65b474b40b4f71e2405b70337fe709
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to django-3.2 (8e4da7f)