...
A message is resent after the LND transmit deadline expires, or on failure return code. Both these paths are handled in the same manner, since a transmit deadline triggers a call to lnet_finalize(). Both inline and aysnchronous asynchronous errors also endup in lnet_finalize()..
Therefore the desired number of transmits = peer_timeout / LND transmit deadline.
In the default case where LND transmit is set to 50 seconds and the peer_timeout is set to 180 seconds, then LNet will transmist 3 times before it declares the peer dead.
Locking
MD is always protected by the lnet_res_lock, which is CPT specific.
...