From cb5fab0f37fabb9e7cdd6abacc6c3591ae017104 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 27 Feb 2017 10:33:27 +0000 Subject: [PATCH] comment that an event could be sent twice --- .../matrix-org/dendrite/roomserver/input/latest_events.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go b/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go index 0348550bc..55b712d82 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go +++ b/src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go @@ -80,6 +80,8 @@ func doUpdateLatestEvents( // Send the event to the output logs. // We do this inside the database transaction to ensure that we only mark an event as sent if we sent it. + // (n.b. this means that it's possible that the same event will be sent twice if the transaction fails but + // the write to the output log succeeds) // TODO: This assumes that writing the event to the output log is synchronous. It should be possible to // send the event asynchronously but we would need to ensure that 1) the events are written to the log in // the correct order, 2) that pending writes are resent across restarts. In order to avoid writing all the