[tarantool-patches] Re: [PATCH v2] Fix fiber_join() hang in case fiber_cancel() was called

Serge Petrenko sergepetrenko at tarantool.org
Wed Feb 6 15:58:39 MSK 2019


Hi, thankyou for review.
All fixed. Please see v3.

> 6 февр. 2019 г., в 12:55, Vladimir Davydov <vdavydov.dev at 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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190206/f0204904/attachment.html>


More information about the Tarantool-patches mailing list