Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-663

Race condition during policy update causes policy to get in an bad state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.5.0
    • 0.5.1, 0.6.0
    • admin
    • None

    Description

      If two threads try to update one policy simultaneously then it can cause x_policy_resource table to have multiple values for a given policy_id, res_def_id combination. When database gets in this state then that policy can't be read until the x_policy_resource_map and x_policy_resource tables are manually cleared up.

      To reproduce the problem: from two separate shells, update the same policy using REST call in a tight loop. Soon the update calls will return failure with status code 400. At this point the policy is in a bad state in the database. After this point any attempt to update or read the policy will result in failure.

      Expectation is that in case of simultaneous update only one update should succeed other should fail.

      Attachments

        Activity

          People

            madhan Madhan Neethiraj
            alok Alok Lal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: