1. 18 Nov, 2016 4 commits
    • Timothy Andrew's avatar
      Update CHANGELOG for !7528. · be6c7aad
      Timothy Andrew authored
      be6c7aad
    • Timothy Andrew's avatar
      Write a spec covering the race condition during group deletion. · 62e9f724
      Timothy Andrew authored
      - Use multiple threads / database connections to:
      
        1. Escape the transaction the spec seems to be running
           in (`config.use_transactional_fixtures` is off, but
           `ActiveRecord::Base.connection.open_transactions` is not empty
           at the beginning of the spec.
      
        2. Simulate a Sidekiq worker performing the hard delete outside of the
           soft-delete transaction.
      
      - The spec is a little clunky, but it was the smallest thing I could get
        working - and even this took a couple of hours. Let me know if you
        have any suggestions to improve it!
      62e9f724
    • Timothy Andrew's avatar
      Fix a race condition that allowed soft-deleted groups to remain in the database. · 2aa3d3de
      Timothy Andrew authored
      The intended flow is:
      
        Soft-delete group (sync) -> Delete group projects (async) -> Hard-delete group (async)
      
      The soft-delete was run in a transaction, which was committed only after
      the async job (for hard-deletion) was kicked off. There was a race
      condition here - the soft-delete transaction could complete _after_ the
      hard delete completed, leaving a soft-deleted record in the database.
      
      This commit removes this race condition. There is no need to run the
      soft-delete in a transaction. The soft-delete completes before the async
      job is kicked off.
      2aa3d3de
    • Timothy Andrew's avatar
      Add a migration to remove soft-deleted groups. · b2669810
      Timothy Andrew authored
      The database should not have any soft-deleted groups. Due to a race
      condition (soft-delete completes after the hard-delete), soft-deleted
      groups were (incorrectly) left in the database, causing issues while
      trying to create a new group with the same name.
      b2669810
  2. 17 Nov, 2016 15 commits
  3. 16 Nov, 2016 21 commits