...
All of these cases should end up calling lnet_finalize() API with the proper return code. lnet_finalize() will be the funnel where all these events shall be processed in a consistent manner. When the message is completed via lnet_complete_msg_locked(), the error is checked and the proper behavior as described above is executed.
Resend Window
The resend window is Resends are terminated when the peer_timeout , after which the peer is considered downfor a message expires.
Resends should also terminate if all local_nis and/or peer_nis are in bad health. New messages can still use paths that have less than optimal health.
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 asynchronous errors also endup in lnet_finalize().
...
The MD should be kept intact during the resend procedure. If there is a failure to resend then the MD should be released and message memory freed.
Patches
- Add health values to local_ni
- Modify selection to make use of local_ni health values.
- Add explicit constraint in the selection to fail a re-send if no local_ni is in optimal health
- Handle explicit port down/up events
- Handle local interface failure on send and update health value then resend
- Add health values to peer_ni
- Add explicit constraint in the selection to fail a re-send if no remote_ni is in optimal health
- Handle remote interface failure on send and update health value then resend
- Modify selection to make use of peer_ni health values.
- Handle LND tx timeout due to being stuck on the queues for too long.
- Handle LND tx timeout due to remote rejection
- Handle LND tx timeout due to no tx completion
O2IBLND Detailed Discussion
...