• H
    Using lwlock to protect resgroup slot in session state · a4cb06b4
    Hubert Zhang 提交于
    Resource group used to access resGroupSlot in SessionState without
    lock. This is correct when session only access resGroupSlot by itself.
    But as we introduced runaway feature, we need to traverse the current
    session array to find the top consumer session when redzone is reached.
    This requires:
    1. runaway detector should hold shared resgroup lock to avoid resGroupSlot
    is detached from a session concurrently when redzone is reached.
    2. normal session should hold exclusive lock when modifying resGroupSlot
    in SessionState.
    
    Also fix a compile warning.
    Reviewed-by: NNing Yu <nyu@pivotal.io>
    a4cb06b4
ic_proxy_main.c 13.5 KB