You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kevin Pilch-Bisson <ke...@pilch-bisson.net> on 2001/09/20 13:50:51 UTC
aborting txn's
Hey,
In trying to get pre-commit hooks working, I have run into an interesting
situation. In hooks.c if the precommit hook fails, then svn_fs_abort_txn
is called on the txn, then the error is returned.
At that point ra_local catches the error and tries to abort the txn again
(which fails). mod_dav_svn on the other hand, never aborts the txn.
My suggestion is that mod_dav_svn should abort the txn, and hooks.c should
leave it alone. Thoughts?
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson http://www.pilch-bisson.net
"Historically speaking, the presences of wheels in Unix
has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: aborting txn's
Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Sep 20, 2001 at 12:01:13PM -0500, Ben Collins-Sussman wrote:
> Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
>
> > Thus we can do one of two things. Add a call to svn_fs_abort_txn in
> > mod_dav_svn in the case where svn_repos_fs_commit_txn returns erorr, or
> > remove the call in libsvn_repos:get_editor.c, and call it within
> > svn_repos_fs_commit_txn for all error cases instead of just one.
> >
> > I decided on the former, which I will commit now, but if people are against
> > it, I can change it to be the latter.
>
> Yeah, that sounds like a reasonable choice. Let mod_dav_svn do it.
>
Just waiting to find out how portable the status codes returned from
apr_proc_wait really are. See my message to the dev@apr list this morning.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson http://www.pilch-bisson.net
"Historically speaking, the presences of wheels in Unix
has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: aborting txn's
Posted by Ben Collins-Sussman <su...@collab.net>.
Kevin Pilch-Bisson <ke...@pilch-bisson.net> writes:
> Thus we can do one of two things. Add a call to svn_fs_abort_txn in
> mod_dav_svn in the case where svn_repos_fs_commit_txn returns erorr, or
> remove the call in libsvn_repos:get_editor.c, and call it within
> svn_repos_fs_commit_txn for all error cases instead of just one.
>
> I decided on the former, which I will commit now, but if people are against
> it, I can change it to be the latter.
Yeah, that sounds like a reasonable choice. Let mod_dav_svn do it.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: aborting txn's
Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Thu, Sep 20, 2001 at 09:50:51AM -0400, Kevin Pilch-Bisson wrote:
> Hey,
>
> In trying to get pre-commit hooks working, I have run into an interesting
> situation. In hooks.c if the precommit hook fails, then svn_fs_abort_txn
> is called on the txn, then the error is returned.
>
>
> At that point ra_local catches the error and tries to abort the txn again
> (which fails). mod_dav_svn on the other hand, never aborts the txn.
>
> My suggestion is that mod_dav_svn should abort the txn, and hooks.c should
> leave it alone. Thoughts?
Let me clarify a bit more. Specifically the cleanup for fail pre-commit hooks
takes place in hooks.c:svn_repos_fs_commit_txn. However, there are a number
of other errors which could occur in that function, none of which result
in the txn being aborted. So why is run_pre_commit_hook and different?
Answer: It's not.
Thus we can do one of two things. Add a call to svn_fs_abort_txn in
mod_dav_svn in the case where svn_repos_fs_commit_txn returns erorr, or
remove the call in libsvn_repos:get_editor.c, and call it within
svn_repos_fs_commit_txn for all error cases instead of just one.
I decided on the former, which I will commit now, but if people are against
it, I can change it to be the latter.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson http://www.pilch-bisson.net
"Historically speaking, the presences of wheels in Unix
has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~