/[Apache-SVN]
ViewVC logotype

Revision 1701298


Jump to revision: Previous Next
Author: ivan
Date: Fri Sep 4 17:24:34 2015 UTC (8 years, 7 months ago)
Changed paths: 3
Log Message:
Fix spurious 'Access Denied' errors during checkout or commit on Windows
reported on TortoiseSVN users mailing list [1].

The issue can be reproduced locally even though known problems reports are
with working copies stored on network share. The reproduction script is:
1. Checkout working copy with a file 'foo'
2. Run 'for /L %I in (1,1,50000000) do type foo' command in background to
   emulate indexers/antivirus scanners
3. Modify file 'foo' in repository via another working copy.
4. Update the original working copy with 'type foo' running

The real fix is to add retry loop for SetFileInformationByHandle() call. All
other changes are refactoring to move existing platform specific code from
libsvn_subr/stream.c to libsvn_subr/io.c to use WIN32_RETRY_LOOP macro. We
already have retry loops for almost all IO operations on Windows.

[1] http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3134203

* subversion/include/private/svn_io_private.h
  (svn_io__win_delete_file_on_close, svn_io__win_rename_open_file): Declare
   new library private functions.

* subversion/libsvn_subr/io.c
  (FILE_RENAME_INFO, FILE_DISPOSITION_INFO, FileRenameInfo,
   FileDispositionInfo, SetFileInformationByHandle_t,
   set_file_information_by_handle_proc): Move it here from
   libsvn_subr/stream.c.

  (win_init_dynamic_imports): Obtain pointer to SetFileInformationByHandle().

  (win32_set_file_information_by_handle): New helper.

  (svn_io__win_delete_file_on_close): New. Implementation extracted from
   svn_stream__install_delete().

  (svn_io__win_rename_open_file): New. Implementation extracted from
   svn_stream__install_stream(). Retry operation on Access Denied errors.
   
* subversion/libsvn_subr/stream.c
  (FILE_RENAME_INFO, FILE_DISPOSITION_INFO, SetFileInformationByHandle_t):
   Move to libsvn_subr/io.c.

  (SetFileInformationByHandle, SetFileInformationByHandle_a,
   find_SetFileInformationByHandle): Remove.

  (svn_stream__install_stream): Use svn_io__win_rename_open_file().
  
  (svn_stream__install_delete): Use svn_io__win_delete_file_on_close().


Changed paths

Path Details
Directorysubversion/trunk/subversion/include/private/svn_io_private.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_subr/io.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_subr/stream.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26