Modify

Opened 9 years ago

Closed 8 years ago

#3772 closed defect (fixed)

[patch] Race condition in TicketRPC.update()

Reported by: Michael Stone Owned by: Odd Simon Simonsen
Priority: highest Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description (last modified by Odd Simon Simonsen)

There is a race between t.save_changes() and tn.notify() in TicketRPC.update() in tracrpc/ticket.py which can result in Trac sending notification emails with empty changelogs. I believe that this race can be fixed with the following simple patch:

Index: ticket.py
===================================================================
--- ticket.py   (revision 4311)
+++ ticket.py   (working copy)
@@ -102,7 +102,7 @@
         t = model.Ticket(self.env, id)
         for k, v in attributes.iteritems():
             t[k] = v
-        t.save_changes(req.authname or 'anonymous', comment)
+        t.save_changes(req.authname or 'anonymous', comment, when=now)
 
         if notify:
             try:

Attachments (0)

Change History (6)

comment:1 Changed 9 years ago by Michael Stone

Many thanks to coderanger for guiding me through the Trac codebase as I diagnosed this issue.

comment:2 Changed 8 years ago by Steffen Pingel

Description: modified (diff)
Priority: normalhighest
Summary: Race condition in TicketRPC.update()[patch] Race condition in TicketRPC.update()

comment:3 Changed 8 years ago by Odd Simon Simonsen

Resolution: fixed
Status: newclosed

(In [6055]) XmlRpcPlugin: Fix for possible ticket update race condition. Closes #3772.

Thanks to mstone for report and patch.

comment:4 Changed 8 years ago by Odd Simon Simonsen

Description: modified (diff)
Resolution: fixed
Status: closedreopened

Reopen to change owner.

comment:5 Changed 8 years ago by Odd Simon Simonsen

Owner: changed from Alec Thomas to Odd Simon Simonsen
Status: reopenednew

comment:6 Changed 8 years ago by Odd Simon Simonsen

Resolution: fixed
Status: newclosed

...and closing again.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Odd Simon Simonsen.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.