Formaline can enter into an infinite loop if git-lock.pl cannot create its lock directory

Issue #1054 closed
Roland Haas created an issue

if for some reason the source base directory returned by git-get-localdir.pl is not accessible (eg. since one has uses an invalid or empty (simfactory) defs.local.ini) then the loop in line 35 of git-lock.pl:

    32  my $waittime = 0.01;
    33  my $maxwaittime = 10;
    34  print "Attempting to obtain $lockdir cwd = ".getcwd()." GIT_DIR=$git_dir\n";
    35  while (! (mkdir $lockdir)) {
    36      # Wait some time
    37      my $unit = $waittime==1 ? "second" : "seconds";
    38      print "Git repository is busy; waiting $waittime $unit...\n";
    39      system "sleep '$waittime'";
    40      # Back off exponentially
    41      $waittime *= 2;
    42      $waittime = 1 if $waittime>1 && $waittime<2;
    43      $waittime = $maxwaittime if $waittime > $maxwaittime;
    44  }

never quits and without SILENT=no the make system also does not output the "Git repository busy" messages it seems.

Possible remedies would seem to either introduce a timeout after which Formaline gives up and does not push into the source code repository (with a loud warning at the end) or to ensure that the print statement's output appears on screen.

It might also be useful to add an option to Formaline to not rely on simfactory. Right now without simfactory it will fail at some later point in the build process (since it cannot call simfactory/bin/sim whoami) or might use the wrong local source path (if simfactory is downloaded but not properly set up).

Keyword: Formaline

Comments (4)

  1. Erik Schnetter
    • removed comment

    Yes, Formaline needs to check whether Simfactory returns reasonable information.

    In this case, Formaline should check whether the directory is writable (i.e. whether other directories can be created there); if not, it should skip using git and emit a warning.

  2. Erik Schnetter
    • removed comment

    git-lock.pl now checks whether there is an error when creating lock directories. Does this solve this problem?

  3. Log in to comment