Skip to content

Commit

Permalink
for #1297, mdelaylatest... fileOps should be dispatched, not dropped.
Browse files Browse the repository at this point in the history
with an update to an ordinary file, each new content replaces the old
but sometimes there is a sequence of events, where order is necessary.
so dispatch the earlier event immediately, rather than discarding it.
  • Loading branch information
petersilva committed Jan 10, 2025
1 parent 26cf6b5 commit 039ece6
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions sarracenia/flowcb/mdelaylatest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ def after_accept(self, worklist):
new_ok_delay = []
for m2 in self.ok_delay:
if m1['relPath'] == m2['relPath']:
logger.info(
f"intermediate version suppressed: {m1['relPath']}")
self.suppressions += 1
new_ok_delay.append(m1)
worklist.rejected.append(m2)
# an mkdir, rmdir, an rm, a rename, an ln: order important, publish immediately.
if ('fileOp' in m2) or ('fileOp' in m1):
if 'fileOp' in m2:
op=m2['fileOp']
else:
op=f"being later: {m1['fileOp']}"

logger.info( f"critically ordered operation: {m2['relPath']} {op}")
new_incoming.append(m2)
new_ok_delay.append(m1)
else:
logger.info( f"intermediate version suppressed: {m1['relPath']}")
self.suppressions += 1
new_ok_delay.append(m1)
worklist.rejected.append(m2)
wait = True
else:
new_ok_delay.append(m2)
Expand Down

0 comments on commit 039ece6

Please sign in to comment.