#1035 new enhancement

add API to atomically set a child URI and return both the new child and its metadata

Reported by: davidsarah Owned by:
Priority: major Milestone: soon
Component: code-dirnodes Version: 1.6.1
Keywords: metadata Cc:
Launchpad Bug:

Description

The set_uri and set_node operations of a DirectoryNode set a child directory entry to a new URI or node object respectively. They return a Deferred for the new child.

It would be useful to be able to return a (child, metadata) pair instead, i.e. to include the metadata that was actually used (including times that are set automatically). This avoids a race condition where the child may be deleted or its metadata changed between set_uri/set_node and a call to get_metadata_for. For example the new SFTP implementation would like to use this operation in its code for supporting the EXCL flag (atomic file creation).

I suggest a return_child_and_metadata option argument defaulting to False, rather than new methods.

Change History (1)

comment:1 Changed at 2010-08-09T22:19:33Z by zooko

  • Milestone changed from 1.8.0 to soon
Note: See TracTickets for help on using tickets.