Re: Random crud left behind by aborted TAP tests

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Random crud left behind by aborted TAP tests
Date: 2015-12-04 16:46:54
Message-ID: 20151204164654.GC2763@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Tom Lane wrote:
> > Yesterday I was fooling around with the TAP tests, and at least once
> > I changed my mind and control-C'd out of a run. Today I find:
> >
> > [postgres(at)sss1 pgsql]$ git status
> > On branch master
> > Your branch is up-to-date with 'origin/master'.
> >
> > Untracked files:
> > (use "git add <file>..." to include in what will be committed)
> >
> > src/bin/scripts/tmp_testGvBC/
>
> Hmm ... I would have supposed that this directory should have been
> removed by File::Temp's END block. Are END blocks abandoned completely
> when a signal is received? That seems pretty surprising.

Yes, they are. Quoth man perlmod:

An "END" code block is executed as late as possible, that is,
after perl has finished running the program and just before
the interpreter is being exited, even if it is exiting as a
result of a die() function. (But not if it's morphing into
another program via "exec", or being blown out of the water
by a signal--you have to trap that yourself (if you can).)

One option is to install a signal handler somewhere to clean this up.
Perhaps we can just set $SIG{INT} to a function that calls "die" or
something like that. But this doesn't solve the problem if the system
crashes while a test is running, for instance, so perhaps your idea of
moving these directories to inside tmp_check/ is good.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-12-04 16:59:26 Re: Random crud left behind by aborted TAP tests
Previous Message Jehan-Guillaume de Rorthais 2015-12-04 16:45:55 Replication stats from slaves