From: Ian Campbell <ian.campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [OSSTEST PATCH 6/9] db_retry: Suppress an "exiting via last" warning
Date: Thu, 17 Dec 2015 18:10:01 +0000 [thread overview]
Message-ID: <1450375801.1617.86.camel@citrix.com> (raw)
In-Reply-To: <22130.62853.68527.604758@mariner.uk.xensource.com>
On Thu, 2015-12-17 at 17:48 +0000, Ian Jackson wrote:
> Ian Campbell writes ("Re: [OSSTEST PATCH 6/9] db_retry: Suppress an
> "exiting via last" warning"):
> > On Thu, 2015-12-17 at 17:06 +0000, Ian Jackson wrote:
> > > This warning appears when db_retry_abort is used, since 2b069b6c
> > > "Database locking: Perl: Retry all deadlocks in PostgreSQL".
> >
> > Is the reason for not turning this into a return related to the
> fact this
> > is within an eval, not a proper sub? But then I'm not really sure
> why it is
> > warning (I suppose eval has some sub like properties?).
>
> I think it's a warning because eval does not trap `last's (nor
> `return's). This means that if you think `eval' can be used to make
> try-finally, you will be disappointed.
>
> (Unlike, in Tcl, say, where `break' and `continue' and indeed
> `return
> are implemented as exceptions.)
>
> Why would `return' be better ? It would still generate the same
> warning. Leaving the loop via `last' seems less heavyweight than
> using `return' and less likely to produce bugs in future patches whose
> authors don't spot the non-local exit.
I think I'm probably confused about the scope of the eval vs
{last,return} etc. In any case, that's no reason to block this patch
AFAICT: Acked-by: Ian Campbell <ian.campbell@citrix.com>
Ian.
>
> > Related to
> https://rt.perl.org/Public/Bug/Display.html?id=29238 perhaps.
>
> I don't think so, although there seems to be a fair amount of
> confusion there.
>
> Ian.
next prev parent reply other threads:[~2015-12-17 18:10 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 17:06 [OSSTEST PATCH 1/9] README.dev: Document the blessings Ian Jackson
2015-12-17 17:06 ` [OSSTEST PATCH 2/9] mg-schema-test-database: Provide some timeouts which are better for testing Ian Jackson
2015-12-17 17:19 ` Ian Campbell
2015-12-17 17:06 ` [OSSTEST PATCH 3/9] mg-schema-test-database: Wipe previous local plan data Ian Jackson
2015-12-17 17:22 ` Ian Campbell
2015-12-17 17:37 ` Ian Jackson
2015-12-17 17:42 ` Ian Campbell
2015-12-17 17:50 ` Ian Jackson
2015-12-17 18:11 ` Ian Campbell
2015-12-17 17:06 ` [OSSTEST PATCH 4/9] mg-schema-test-database: Borrow shares properly Ian Jackson
2015-12-17 17:26 ` Ian Campbell
2015-12-17 17:43 ` Ian Jackson
2015-12-17 18:08 ` Ian Campbell
2015-12-17 17:06 ` [OSSTEST PATCH 5/9] ms-planner: Improve an error message Ian Jackson
2015-12-17 17:26 ` Ian Campbell
2015-12-17 17:06 ` [OSSTEST PATCH 6/9] db_retry: Suppress an "exiting via last" warning Ian Jackson
2015-12-17 17:31 ` Ian Campbell
2015-12-17 17:48 ` Ian Jackson
2015-12-17 18:10 ` Ian Campbell [this message]
2015-12-17 18:38 ` Ian Jackson
2015-12-18 11:14 ` Ian Campbell
2015-12-18 14:39 ` Ian Jackson
2015-12-17 17:06 ` [OSSTEST PATCH 7/9] Executive DB retry: Avoid an undefined warning Ian Jackson
2015-12-17 17:31 ` Ian Campbell
2015-12-17 17:06 ` [OSSTEST PATCH 8/9] mg-allocate: Better error handling when no candidates Ian Jackson
2015-12-17 17:33 ` Ian Campbell
2015-12-17 17:06 ` [OSSTEST PATCH 9/9] mg-allocate: In planner mode, pre-check the arguments Ian Jackson
2015-12-17 17:33 ` Ian Campbell
2015-12-17 17:18 ` [OSSTEST PATCH 1/9] README.dev: Document the blessings Ian Campbell
2015-12-17 17:59 ` Ian Jackson
2015-12-17 18:12 ` Ian Campbell
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=1450375801.1617.86.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.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 NNTP newsgroup(s).