Tags:
create new tag
view all tags

Feature Proposals » saveFile function to be atomic -- writing completely or not writing at all

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
AcceptedProposal HideyoImazu AcceptedByReleaseMeeting 2016-11-10   TWikibug:Item7760 KampalaRelease

Edit Form

TopicSummary:
CurrentState:
CommittedDeveloper:
ReasonForDecision:
DateOfCommitment:   Format: YYYY-MM-DD
ConcernRaisedBy:
BugTracking:
OutstandingIssues:
RelatedTopics:
InterestedParties:
ProposedFor:
TWikiContributors:
 

Motivation

TWiki::Store::RcsFile::saveFile() writes to a specified file naively. So a file may have a partially written content if saveFile() is interrupted after it starts writing but before it completes writing. saveFile() should be atomic -- writing completely or not writing at all.

Description and Documentation

Instead of writing naively, writing to a temporary file and then renaming to the specified name makes saveFile() atomic. More specifically, it will writie to a file name having ".PROCESS_ID" appended, and then it will rename to the specified file name.

Examples

Impact

Implementation

-- Contributors: Hideyo Imazu - 2016-11-10

Discussion

Yes, indeed, good proposal.

-- Peter Thoeny - 2016-11-17

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2016-11-21 - HideyoImazu
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.