801e985 backend: use lock(timeout=5) to work-around fair-locks

Authored and Committed by praiskup 2 years ago
    backend: use lock(timeout=5) to work-around fair-locks
    
    It is not easy to implement fair locking.  Having unfair locks,
    previously some of the copr-repo processes were waiting awfully long for
    the lock even though other copr-repo processes already finished theirs
    task.
    
    So don't indefinitely wait for the lock (implement timeout with several
    seconds), and try checking for the status periodically (without lock).
    If task status is filled, finish early.
    
    Because osloutils lock() doesn't have timeout= argument, and fair=True
    doesn't work - I'm switching the code against the filelock module (as
    per rhbz#1968789 suggestion).
    
    Some new commands appeared, so add a test-case to cover them.
    
    Relates: #1423
    
        
  • Zuul
    success
    Jobs result is success
    2 years ago
  • Copr build
    success (100%)
    #2842698
    2 years ago
  • Copr build
    success (100%)
    #2843081
    2 years ago
file modified
+2 -2
file modified
+49 -13