Commit Graph

101 Commits

Author SHA1 Message Date
19c76b2c24 Use gettimeofdayInMilliseconds instead of gettimeofdayInMilliseconds* functions 2017-03-30 17:11:33 +02:00
0e167e4b1a Sync lock changes from nomerge2 to master 2017-03-24 14:05:44 +01:00
a7ab0fd0c7 Demote logging ERR to WRN when rollback-move fails when unlinking non-existing destination file 2017-02-27 15:42:24 +01:00
dc2b38d03e Enlarged lock scope in File::getfd() 2017-01-07 16:27:17 +01:00
9a3eae3fe7 Log when closing a file descriptor 2017-01-06 13:42:46 +01:00
e551a73e89 Add more trace logs 2016-12-30 15:36:59 +01:00
0d5e6f8562 Fix bug where map file was truncated 2016-12-30 15:36:59 +01:00
c235ae5d0e Add some error conditions checks for open & dup2 2016-12-30 12:38:38 +01:00
dbcd7b6a6d Don't close fd directly after rename, but instead redirect fd to new file 2016-12-30 12:30:59 +01:00
7e4914bb10 Add more trace logs 2016-12-30 12:30:59 +01:00
2d204ddfe7 Modify logs to use logError 2016-12-30 12:30:59 +01:00
bec2c03d02 Removed last use of O_NONBLOCK / O_ASYNC on files.
O_ASYNC doesn't work on files. O_NONBLOCK is generally useless onless dealing with mandatory file locks.
2016-12-20 14:55:47 +01:00
445c819273 close fd after file move (because if the move was across filesystem then we have a new file) 2016-12-19 11:59:09 +01:00
c23eaf9ddf #include cleanup of File.h 2016-10-28 14:12:25 +02:00
4d01bda9e8 Removed permissions parameter from File::open() because it was only specified by BigFile.cpp and that used the same value as getFileCreationFlags() 2016-10-28 14:08:31 +02:00
7c97e45695 Use 2-phase move/rename in BigFile 2016-10-28 13:38:50 +02:00
58b9015fcd Removed 'force' functionalit yon file rename operations
In normal circumstances the destination file should not exist. spidering/merging/querying works fine. recovery logic may have to get fixed too.
2016-10-25 16:12:17 +02:00
b994bf8941 Moved blocking rename/unlink logic out of generalized BigFile::renameUnlink() 2016-10-25 12:09:41 +02:00
a1c545c2c1 Added File::movePhase1()/movePhase2() 2016-10-24 15:59:23 +02:00
143ed38c0b Removed File::getForceRename() (it was only used internally) 2016-10-24 15:34:41 +02:00
f4859a3c6b int/char -> bool in File 2016-10-19 12:13:06 +02:00
ada927bab0 Remove XOPEN_SOURCE defines 2016-10-11 13:54:55 +02:00
18cc372064 Potentially ugly. File::getfd would happily use return value from ::open to index into arrays when larger than MAX_NUM_FDS. Fixed. 2016-09-24 22:16:59 +02:00
e4685908e7 init File class members in constructor 2016-09-24 21:50:56 +02:00
49d9c5c1b7 Fix always-true if() 2016-09-06 21:01:37 +02:00
325ccfe455 Cleanup in File.* 2016-09-06 14:46:18 +02:00
450fccd43b Removed doesFileExist() (only used once and not worth the trouble) 2016-09-06 14:46:18 +02:00
63762342bb constness on static 2016-08-21 17:26:09 +02:00
7ff2381952 Added GbMutex class
Use -DDEBUG_MUTEXES to enable heavy-duty error checking on mutexes
2016-08-15 16:24:56 +02:00
a8652e0e67 #include cleanup in File.h (and resulting other cleanup) 2016-08-10 00:32:00 +02:00
4e4e3371e6 Log function will now return void instead of a boolean 2016-08-01 18:12:10 +02:00
adf39d81bf Use UnlinkRenameState instead of File directly for jobs.
This is because we want to store errno, and this also remove the link between File & BigFile
2016-07-29 13:54:53 +02:00
26ce7dbe3d Removed checks for EINTR and bogus comment about it
EINTR shouldn't happen anymore now that we use SA_RESTART. The comments about the EINTR being cause by valgrind were bogus. The real cause was the 1ms-timer signal interrupting many system calls.
2016-07-29 13:51:53 +02:00
3c2773a928 Removed gbstrlen()
gbstrlen() just checked for NULL and called gbshutdownAbort(). Dereferncing NULL on mordern platforms cases a SIGSEGV which is cought by our signal handler and .... gbshutdownAbort() is called. So gbstrlen() was superfluous and complicated static analysis.
2016-07-28 17:04:35 +02:00
74eda7617b Code style changes 2016-07-27 09:14:35 +02:00
8ecedbe76b Remove sync() call from unlink. It's only called on unlink error anyway. 2016-07-19 11:29:00 +02:00
7b200ef3f0 Code style changes. Log WARN instead of DEBUG 2016-07-19 11:28:05 +02:00
2499a000ab Use File::rename in BigFile::rename to simplify BigFile::rename logic 2016-07-15 16:58:43 +02:00
0661bf1f2e Synchronize File::open() and File::close()
Multiple threads could call File::open() for the same instance and end up leaking
file descriptors. Mutex added to open/close. This doesn't solve all race
conditions but should prevent the most frequent ones. bigfile/merge still calls
close1_r/close2/getfd directly so those race conditions 8although presumably
rare) are still possible.
2016-07-15 14:40:22 +02:00
35c164bb70 Remove close from rename functions 2016-07-15 14:38:26 +02:00
e012646fb0 Removed 2-phase File:: constructor()/destructor() 2016-07-14 15:48:50 +02:00
b1d2d8db6b Protect s_* state arrays in File.cpp with mutex 2016-07-14 15:32:51 +02:00
3f77fd9b90 Various cleanup in File. 2016-07-14 14:38:33 +02:00
68ae0189a0 Removed obsolete code 2016-07-14 14:18:25 +02:00
ce7511a1a9 Removed cygwin support 2016-07-14 14:06:09 +02:00
7dc5bd68db Removed obsolete commneted-out code 2016-07-14 14:02:55 +02:00
9a078388bc gbmemcpy(filename) -> plain memcpy 2016-07-14 14:02:39 +02:00
3cffecaf77 File: s_writing:s_unlinking:s_open char->bool 2016-07-14 12:59:43 +02:00
a509de5a05 cleanup in File.* 2016-07-14 12:43:44 +02:00
244a856032 Code style changes 2016-07-11 17:14:10 +02:00