Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORTX-33564: Fixed panic in rpc_session_cancelled() due to session state
Problem: While session was getting canceled some other thread is trying to terminate that session and moves session state to M0_RPC_SESSION_TERMINATING, which lead to hit assert M0_POST(session->s_sm.sm_state == M0_RPC_SESSION_IDLE) in rpc_session_cancel(). Seagate#5 in m0_arch_panic (c=c@entry=0x7f7276a91b40 <__pctx.14289>, ap=ap@entry=0x7f7268c05ce0) at lib/user_space/uassert.c:131 Seagate#6 in m0_panic (ctx=ctx@entry=0x7f7276a91b40 <__pctx.14289>) at lib/assert.c:52 Seagate#7 in m0_rpc_session_cancel (session=session@entry=0x56283c7c13d8) at rpc/session.c:863 Seagate#8 in m0_rpc_conn_sessions_cancel (conn=conn@entry=0x56283c7c1030) at rpc/conn.c:1333 Seagate#9 in rpc_conn__on_service_event_cb (clink=<optimized out>) at rpc/conn.c:1364 Seagate#10 in clink_signal (clink=clink@entry=0x56283c7c12c0) at lib/chan.c:135 Seagate#11 in chan_signal_nr (chan=chan@entry=0x56283c6a8768, nr=1) at lib/chan.c:154 Seagate#12 in m0_chan_broadcast (chan=chan@entry=0x56283c6a8768) at lib/chan.c:174 Seagate#13 in ha_state_accept (ignore_same_state=1, note=0x7f7268c06060, confc=0x56283816b028) at ha/note.c:18 Solution: It is possible that some other thread is trying to terminate the same session while session is getting cancelled, only the IDLE/BUSY sessions are allowed to cancel. Updated pre check to return from m0_rpc_cancel instead of panic/assert. Also replaced M0_POST()/assert with proper debug log. Signed-off-by: Yatin Mahajan <yatin.mahajan@seagate.com>
- Loading branch information