Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: pkg/analysis_services/lib/src/index/store/temporary_folder_file_manager.dart

Issue 429323002: Ignore file system errors when deleting analysis server index dir. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_services/lib/src/index/store/temporary_folder_file_manager.dart
diff --git a/pkg/analysis_services/lib/src/index/store/temporary_folder_file_manager.dart b/pkg/analysis_services/lib/src/index/store/temporary_folder_file_manager.dart
index 1e30417d0d3253358d44fb187400bef46b0f62a4..331da600638d3557027f2d3674df9f4ea63d600e 100644
--- a/pkg/analysis_services/lib/src/index/store/temporary_folder_file_manager.dart
+++ b/pkg/analysis_services/lib/src/index/store/temporary_folder_file_manager.dart
@@ -23,7 +23,19 @@ class TemporaryFolderFileManager implements FileManager {
@override
void clear() {
if (_directory != null) {
- _directory.deleteSync(recursive: true);
+ try {
+ _directory.deleteSync(recursive: true);
+ } on FileSystemException {
+ // For some reason, on Windows this sometimes results in the error:
+ // "FileSystemException: Deletion failed, path = '...' (OS Error: The
+ // process cannot access the file because it is being used by another
+ // process., errno = 32). (Speculation: perhaps createTempSync is not
+ // successfully creating a unique name, so multiple processes are
+ // trying to access the same file?)
+ //
+ // For now, work around the problem by ignoring the exception.
+ // TODO(paulberry): fix the actual root cause of this bug.
+ }
_directory = null;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698