[Tarantool-patches] [PATCH v2 3/3] alter: do not catch exceptions when it's not necessary

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Mon Jul 13 21:34:44 MSK 2020


On 13.07.2020 16:18, Aleksandr Lyapunov wrote:
> Some method are guarantee to be noexcept, we should not try them.
> 
> Closes #5153
> ---
>  src/box/alter.cc | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/src/box/alter.cc b/src/box/alter.cc
> index 9b2b8e8..1807c33 100644
> --- a/src/box/alter.cc
> +++ b/src/box/alter.cc
> @@ -1030,12 +1030,8 @@ alter_space_rollback(struct trigger *trigger, void * /* event */) noexcept
>  	struct alter_space *alter = (struct alter_space *) trigger->data;
>  	/* Rollback alter ops */
>  	class AlterSpaceOp *op;
> -	try {
> -		rlist_foreach_entry(op, &alter->ops, link) {
> -			op->rollback(alter);
> -		}
> -	} catch (Exception *e) {
> -		return -1;
> +	rlist_foreach_entry(op, &alter->ops, link) {
> +		op->rollback(alter);
>  	}
>  	/* Rebuild index maps once for all indexes. */
>  	space_fill_index_map(alter->old_space);

My comment to the previous version still remains:

	1. This one is good. Try-catch wasn't needed here. But it looks like related to
	the previous commit. Not to this one.

You did exactly the same change for on_commit triggers in
the first commit. Why did you move on_rollback change into a
separate commit?


More information about the Tarantool-patches mailing list