Skip to content

Commit 0abfbb2

Browse files
author
Ashish Chhabria
committed
adding details on SessionLockLostException
1 parent ce39edd commit 0abfbb2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

articles/service-bus-messaging/service-bus-messaging-exceptions.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The lock on a message may expire due to various reasons -
114114

115115
### Resolution
116116

117-
In the event of a **MessageLockLostException**, the client application can no longer process the message. The client application may optionally consider logging the exception for analysis, but *must* dispose off the message.
117+
In the event of a **MessageLockLostException**, the client application can no longer process the message. The client application may optionally consider logging the exception for analysis, but the client *must* dispose off the message.
118118

119119
Since the lock on the message has expired, it would go back on the Queue (or Subscription) and can be processed by the next client application which calls receive.
120120

@@ -124,8 +124,19 @@ If the **MaxDeliveryCount** has exceeded then the message may be moved to the **
124124

125125
### Cause
126126

127+
The **SessionLockLostException** is thrown when a session is accepted and the lock held by the client expires on the service side.
128+
129+
The lock on a session may expire due to various reasons -
130+
131+
* The lock timer has expired before it was renewed by the client application.
132+
* The client application acquired the lock, saved it to a persistent store and then restarted. Once it restarted, the client application looked at the inflight sessions and tried to process the messages in those sessions.
133+
127134
### Resolution
128135

136+
In the event of a **SessionLockLostException**, the client application can no longer process the messages on the session. The client application may consider logging the exception for analysis, but the client *must* dispose off the message.
137+
138+
Since the lock on the session has expired, it would go back on the Queue (or Subscription) and can be locked by the next client application which accepts the session. Since the session lock is held by a single client application at any given time, the in-order processing is guaranteed.
139+
129140
## SocketException
130141

131142
### Cause

0 commit comments

Comments
 (0)