trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: trinity@vger.kernel.org
Subject: Re: endless loop open child logfiles
Date: Fri, 29 Aug 2014 16:10:41 -0400	[thread overview]
Message-ID: <20140829201041.GA2352@redhat.com> (raw)
In-Reply-To: <5400D70F.7040803@gmx.de>

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)

      reply	other threads:[~2014-08-29 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 19:39 endless loop open child logfiles Toralf Förster
2014-08-29 20:10 ` Dave Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140829201041.GA2352@redhat.com \
    --to=davej@redhat.com \
    --cc=toralf.foerster@gmx.de \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).