Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Leonid Vasiliev <lvasiliev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v2] core: handle fiber cancellation for fiber.cond
Date: Tue, 1 Dec 2020 01:49:56 +0300	[thread overview]
Message-ID: <20201130224956.gj6zxz4vewh2hyo2@tkn_work_nb> (raw)
In-Reply-To: <8e3d200a-d97c-6dd6-7f1e-d88e7f4acdac@tarantool.org>

> > diff --git a/src/lib/core/fiber_cond.c b/src/lib/core/fiber_cond.c
> > index 904a350d9..cc59eaafb 100644
> > --- a/src/lib/core/fiber_cond.c
> > +++ b/src/lib/core/fiber_cond.c
> > @@ -108,6 +108,11 @@ fiber_cond_wait_timeout(struct fiber_cond *c, double timeout)
> >   		diag_set(TimedOut);
> >   		return -1;
> >   	}
> > +	if (fiber_is_cancelled()) {
> > +		if (diag_is_empty(diag_get()))
> > +                        diag_set(FiberIsCancelled);
> 
> I read your argumentation. AFAIU sounds like:"We have a lot of tests
> that check an error in the diag in such case. Also, some user
> applications can check the diag in a similar way. And stack diag can be used
> only in the new versions of tarantool." So, it's true.
> What I propose to think about:
> - this is not simple logic. If a fiber has been cancelled, maybe an error
> will be added to the diag, maybe no - 50/50.
> - this behavior should be documented.
> - ask Mons or Turenko for advice: "What do they think about it?"
> All this up to you.

The fiber_channel implementation (C level) convinced me. It is good to
have the similar behaviour in fiber_cond and fiber_channel.

I would only ask to document this subtle difference in our web
documentation. Python document subtle changes (at least some of them)
and it is nice for users. Example:

Python 2:

 | Popen.send_signal(signal)
 |
 | Sends the signal `signal` to the child.

Python 3:

 | Popen.send_signal(signal)
 |
 | Sends the signal `signal` to the child.
 |
 | Do nothing if the process completed.

(It would be better to mark it with 'Since Python x.y.z', though.)

That is the place, where Python 2 and Python 3 behaviour actually
differs (when the popen implementation aware about a process
termination, i.e. after <popen object>.poll()).

It is important, when you writting a code that must work on both Python
2 and Python 3: you should catch OSError here.

  reply	other threads:[~2020-11-30 22:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 16:29 sergos
2020-11-01 10:13 ` Oleg Babin
2020-11-03 10:20   ` Sergey Ostanevich
2020-11-03 10:27     ` Oleg Babin
2020-11-04 10:00     ` Leonid Vasiliev
2020-11-16 22:12     ` Vladislav Shpilevoy
2020-11-18 22:05       ` Sergey Ostanevich
2020-11-22 16:01         ` Vladislav Shpilevoy
2020-11-23 21:47           ` Sergey Ostanevich
2020-11-24  7:31           ` Sergey Ostanevich
2020-11-04 10:00 ` Leonid Vasiliev
2020-11-05 20:42   ` Sergey Ostanevich
2020-11-10 21:16   ` Sergey Ostanevich
2020-11-12 20:15     ` Sergey Ostanevich
2020-11-13  8:26       ` Leonid Vasiliev
2020-11-30 22:49         ` Alexander Turenko [this message]
2020-11-16 22:12 ` Vladislav Shpilevoy
2020-11-25 21:32 ` Vladislav Shpilevoy
2020-11-29 21:41   ` Sergey Ostanevich
2020-11-30 21:46   ` Alexander Turenko
2020-11-30 21:01 ` Vladislav Shpilevoy
2020-12-02 10:58 ` Alexander V. Tikhonov
2020-12-02 22:18 ` Vladislav Shpilevoy

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=20201130224956.gj6zxz4vewh2hyo2@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] core: handle fiber cancellation for fiber.cond' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox