Uploaded image for project: 'Periscope'
  1. Periscope
  2. MGNLPER-72 Make Find Bar result ranking user specific
  3. MGNLPER-77

Make sure JCR search and multiple threads play well together


    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.1
    • None
    • None
    • Foundation 2, Foundation 3

      As creichenbach mentioned while reviewing a related PR:

      "Multiple threads trying to get a session on the same workspace will give you badtimes (IIRC throws an exception on the second one). So far it wasn't an issue because we assumed no one would have multiple suppliers for the same workspace in a normal scenario (but this assumption might be flawed on second thought as well, e.g. pages vs. tours).

      Now, I think we have two options:

      1. Do everything in a single thread. We had this in the beginning, and it's painfully slow. And if we have multiple Periscope instances, it's still not safe the way it is right now - we'd need a globally single thread.
      2. Protect JCR search with semaphores on a per-workspace basis (one semaphore per workspace, each with limit 1). So if two threads happen to try searching the same workspace at the same time, one would be blocked until the other one is done.

      I'd strongly vote for option 2."

      Or perhaps use JCR's own LockManager, assuming that helps in our case, which must be verified https://docs.adobe.com/docs/en/spec/jcr/2.0/17_Locking.html

            creichenbach Cedric Reichenbach
            fgrilli Federico Grilli
            0 Vote for this issue
            2 Start watching this issue