diff mbox series

[b4] Avoid case where message-id and in-reply-to id match

Message ID 20230316055523.728335-1-alison.schofield@intel.com (mailing list archive)
State Accepted
Headers show
Series [b4] Avoid case where message-id and in-reply-to id match | expand

Commit Message

Alison Schofield March 16, 2023, 5:55 a.m. UTC
From: Alison Schofield <alison.schofield@intel.com>

A user error while sending a patchset created a lore link that b4 is
not able to handle. The unexpected matching message-id and in-reply-to
id sends b4 into an infinite loop while 'Analyzing follow-up'.

Add a check and break for this case.

b4 am -c https://lore.kernel.org/all/cover.1674070170.git.alison.schofield@intel.com/

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---

Not so sure this is the first place that b4 can and should detect this.

 b4/__init__.py | 3 +++
 1 file changed, 3 insertions(+)


base-commit: 2eb1ab30a6a6f6b140f19ef36b5af7f73f000720

Comments

Konstantin Ryabitsev March 17, 2023, 1:58 p.m. UTC | #1
On Wed, 15 Mar 2023 22:55:23 -0700, alison.schofield@intel.com wrote:
> A user error while sending a patchset created a lore link that b4 is
> not able to handle. The unexpected matching message-id and in-reply-to
> id sends b4 into an infinite loop while 'Analyzing follow-up'.
> 
> Add a check and break for this case.
> 
> b4 am -c https://lore.kernel.org/all/cover.1674070170.git.alison.schofield@intel.com/
> 
> [...]

Applied, thanks!

[1/1] Avoid case where message-id and in-reply-to id match
      commit: 7c06ad19f6a94d367355e5ae8211c409404c7d7d

Best regards,
diff mbox series

Patch

diff --git a/b4/__init__.py b/b4/__init__.py
index 94c1693..4ed8ad8 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -333,6 +333,9 @@  class LoreMailbox:
                     pmsg.followup_trailers += trailers
                     break
                 if pmsg.in_reply_to and pmsg.in_reply_to in self.msgid_map:
+                    # Avoid bad message id causing infinite loop
+                    if pmsg == self.msgid_map[pmsg.in_reply_to]:
+                        break
                     lvl += 1
                     for pltr in pmsg.trailers:
                         pltr.lmsg = pmsg