From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] Re: [PATCH v2] Fix fiber_join() hang in case fiber_cancel() was called
Date: Wed, 6 Feb 2019 15:58:39 +0300 [thread overview]
Message-ID: <E4E056E6-31A1-48B6-830B-34AB68E9B19B@tarantool.org> (raw)
In-Reply-To: <20190206095555.j5krlav7eawshkkh@esperanza>
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
Hi, thankyou for review.
All fixed. Please see v3.
> 6 февр. 2019 г., в 12:55, Vladimir Davydov <vdavydov.dev@gmail.com> написал(а):
>
> Anyway, now I seem to understand why you wanted to ignore fiber_cancel
> in fiber_join - making it cancellable complicates the function protocol,
> rendering the function barely usable. Guess I was wrong when asked you
> to rework the patch, sorry. Let's revert to v1.
>
>> if (child_L != NULL) {
>> coro_ref = lua_tointeger(child_L, -1);
>> lua_pop(child_L, 1);
>> diff --git a/test/app/fiber.result b/test/app/fiber.result
>> index ab7c1941b..f73d32671 100644
>> --- a/test/app/fiber.result
>> +++ b/test/app/fiber.result
>> @@ -1411,6 +1411,39 @@ l = nil
>> l1 = nil
>> ---
>> ...
>> +-- gh-3948 fiber.join() blocks if fiber is cancelled.
>> +function another_func() fiber.yield() end
>> +---
>> +...
>> +test_run:cmd("setopt delimiter ';'")
>> +---
>> +- true
>> +...
>> +function func()
>> + local fib = fiber.create(another_func)
>> + fib:set_joinable(true)
>> + fib:join()
>> +end;
>> +---
>> +...
>> +f = fiber.create(func)
>> +f:cancel()
>> +while f:status() ~= 'dead' do fiber.sleep(0.01) end;
>
> AFAICS the test highly depends on the scheduler algorithm. Let's rewrite
> it using fiber.channel please.
>
>> +---
>> +...
>> +test_run:cmd("setopt delimiter ''");
>> +---
>> +- true
>> +...
>
>> +f = nil
>> +---
>> +...
>> +func = nil
>> +---
>> +...
>> +another_func = nil
>> +---
>> +...
>
> These assignments aren't necessary.
[-- Attachment #2: Type: text/html, Size: 10557 bytes --]
prev parent reply other threads:[~2019-02-06 12:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-05 15:01 Serge Petrenko
2019-02-06 9:55 ` Vladimir Davydov
2019-02-06 12:58 ` Serge Petrenko [this message]
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=E4E056E6-31A1-48B6-830B-34AB68E9B19B@tarantool.org \
--to=sergepetrenko@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [tarantool-patches] Re: [PATCH v2] Fix fiber_join() hang in case fiber_cancel() was called' \
/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