Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-3917

Suspending a user with many user_sessions results in timeout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 2.7 GA, SaaS
    • System
    • None
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • 3scale 2019-11-11

      While a user has a high number (25k) UserSession suspending it is making the server timeout, thus the transaction is rolled back and the user is never suspended.

      The code responsible of this is: https://github.com/3scale/porta/blob/fadbbd5741e7c1973022fc18f8654af3b5be576b/app/models/user/states.rb#L25

      https://github.com/3scale/porta/blob/fadbbd5741e7c1973022fc18f8654af3b5be576b/app/models/user.rb#L259-L264

      Dev notes

      • Use delete_all instead of destroy_all
      • Or delete the sessions in the background

              Unassigned Unassigned
              hramihaj Hery Ramihajamalala (Inactive)
              Marta Noya Marta Noya (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: