* endless loop open child logfiles
@ 2014-08-29 19:39 Toralf Förster
2014-08-29 20:10 ` Dave Jones
0 siblings, 1 reply; 2+ messages in thread
From: Toralf Förster @ 2014-08-29 19:39 UTC (permalink / raw)
To: trinity
If a (small) file system is fullfilled, then there's an endless loop in opening logiles, tested with 4 childs in a KVM within a 97 MB big BTRFS file system created in a file in a ramdisk, commands are :
$> mkdir /mnt/ramdisk/btrfs; truncate -s 97M /mnt/ramdisk/btrfs.fs; /sbin/mkfs.btrfs /mnt/ramdisk/btrfs.fs; sudo su -c "mount -o loop,compress=lzo /mnt/ramdisk/btrfs.fs /mnt/ramdisk/btrfs; chmod 777 /mnt/ramdisk/btrfs"
$> D=/mnt/ramdisk/btrfs; while [[ : ]]; do cd ~; sudo rm -rf $D/t3; mkdir $D/t3 || break; cd $D/t3; mkdir -p v1/v2; for i in $(seq 0 99); do touch v1/v2/f$i; mkdir v1/v2/d$i; done; trinity -C 4 -N 100000 -V $D/t3/v1/v2; echo; echo " done"; echo; sleep 4; done
--
Toralf
pgp key: 0076 E94E
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: endless loop open child logfiles
2014-08-29 19:39 endless loop open child logfiles Toralf Förster
@ 2014-08-29 20:10 ` Dave Jones
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jones @ 2014-08-29 20:10 UTC (permalink / raw)
To: Toralf Förster; +Cc: trinity
On Fri, Aug 29, 2014 at 09:39:59PM +0200, Toralf Förster wrote:
> If a (small) file system is fullfilled, then there's an endless loop in opening logiles, tested with 4 childs in a KVM within a 97 MB big BTRFS file system created in a file in a ramdisk, commands are :
>
>
> $> mkdir /mnt/ramdisk/btrfs; truncate -s 97M /mnt/ramdisk/btrfs.fs; /sbin/mkfs.btrfs /mnt/ramdisk/btrfs.fs; sudo su -c "mount -o loop,compress=lzo /mnt/ramdisk/btrfs.fs /mnt/ramdisk/btrfs; chmod 777 /mnt/ramdisk/btrfs"
>
> $> D=/mnt/ramdisk/btrfs; while [[ : ]]; do cd ~; sudo rm -rf $D/t3; mkdir $D/t3 || break; cd $D/t3; mkdir -p v1/v2; for i in $(seq 0 99); do touch v1/v2/f$i; mkdir v1/v2/d$i; done; trinity -C 4 -N 100000 -V $D/t3/v1/v2; echo; echo " done"; echo; sleep 4; done
short on time right now, but try this..
Dave
diff --git a/include/exit.h b/include/exit.h
index 948ecea02112..ebbaf98cfaac 100644
--- a/include/exit.h
+++ b/include/exit.h
@@ -19,8 +19,9 @@ enum exit_reasons {
EXIT_FD_INIT_FAILURE = 13,
EXIT_FORK_FAILURE = 14,
EXIT_LOCKING_CATASTROPHE = 15,
+ EXIT_LOGFILE_OPEN_ERROR = 16,
- NUM_EXIT_REASONS = 16
+ NUM_EXIT_REASONS = 17
};
const char * decode_exit(void);
diff --git a/log.c b/log.c
index 22b72db86f3c..0ccd1ba45cc9 100644
--- a/log.c
+++ b/log.c
@@ -60,8 +60,10 @@ void open_child_logfile(struct childdata *child)
sprintf(logfilename, "trinity-child%u.log", child->num);
child->logfile = open_logfile(logfilename);
- if (!child->logfile)
+ if (!child->logfile) {
+ shm->exit_reason = EXIT_LOGFILE_OPEN_ERROR;
exit(EXIT_FAILURE);
+ }
free(logfilename);
diff --git a/main.c b/main.c
index 5541de09ae7e..ed3d02c0d4e5 100644
--- a/main.c
+++ b/main.c
@@ -295,6 +295,7 @@ static const char *reasons[NUM_EXIT_REASONS] = {
"Something happened during fd init.",
"fork() failure",
"some kind of locking catastrophe",
+ "error while opening logfiles",
};
const char * decode_exit(void)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-29 20:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29 19:39 endless loop open child logfiles Toralf Förster
2014-08-29 20:10 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).