Sun 06 Jan 2008 02:13:52 AM UTC, comment #4:
Dean --
I've looked into this and it actually makes sense. The file was opened read/write at some point in the past, and then closed. Now, we want to fsync() it, so we have to reopen it to get a file handle. We don't need R/W, so we ask for RO, but it doesn't work on some platforms.
I've changed:
if (e.errno != errno.EPERM and e.errno != errno.EACCES) \
or self.isdir(): raise
to
if (e.errno not in (errno.EPERM, errno.EACCES, errno.EBADF)) \
or self.isdir(): raise
in CVS.
Andrew
|
Tue 21 Feb 2006 02:30:57 PM UTC, original submission:
I installed rdiff-backup-1.0.4 under AIX 5.3. When running a simple local test backup, I got the following message :
[fthomas@tonga build]$ rdiff-backup SPECS /tmp/backup-fthomas/
Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 23, in ?
rdiff_backup.Main.Main(sys.argv[1:])
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/Main.py", line 285, in Main
take_action(rps)
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/Main.py", line 255, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/Main.py", line 309, in Backup
rpout.conn.Main.backup_touch_curmirror_local(rpin, rpout)
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/Main.py", line 467, in backup_touch_curmirror_local
mirrorrp.fsync_with_dir()
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/rpath.py", line 1080, in fsync_with_dir
self.fsync(fp)
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/rpath.py", line 1068, in fsync
if not fp: self.conn.rpath.RPath.fsync_local(self)
File "/opt/freeware/lib/python2.3/site-packages/rdiff_backup/rpath.py", line 1075, in fsync_local
os.fsync(fd)
OSError: [Errno 9] Bad file number
Exception exceptions.TypeError: "'NoneType' object is not callable" in <bound method GzipFile.__del__ of <gzip open file '/tmp/backup-fthomas/rdiff-backup-data/error_log.2006-02-21T15:27:37+01:00.data.gz', mode 'wb' at 0x202940e8 0x20293698>> ignored
I commented out the os.fsync(fd) line in rpath.py and the problem went away. I believe this is related to the fact that the file is open in read-only and that it's probably forbidden to fsync a file that's open in read-only.
excerpt from rpath.py :
def fsync_local(self):
"""fsync current file, run locally"""
assert self.conn is Globals.local_connection
fd = os.open(self.path, os.O_RDONLY)
#os.fsync(fd)
os.close(fd)
|