[Tarantool-patches] [PATCH v2 0/2] Stacked diagnostic area follow-ups

Kirill Yukhin kyukhin at tarantool.org
Mon Apr 20 18:29:31 MSK 2020


On 20 апр 14:35, Nikita Pettik wrote:
> On 20 Apr 17:22, Kirill Yukhin wrote:
> > Hello,
> > 
> > On 17 апр 23:16, Nikita Pettik wrote:
> > > Branch: https://github.com/tarantool/tarantool/tree/np/gh-4887-ref-error-on-prev
> > > Issue: https://github.com/tarantool/tarantool/issues/4887
> > > 
> > > Changes in v2:
> > > 
> > >  - modified test so that now it uses weak references to check that
> > > gc collected error objects (i.e. there's no memory leaks);
> > >  - added overflow check in error_ref() so that after 2^32 calls
> > > of box.error.last() or error:prev() error object won't contain
> > > broken reference counter.
> > > 
> > > Nikita Pettik (2):
> > >   box/error: don't allow overflow of error ref counter
> > >   box/error: ref error.prev while accessing it
> > 
> > I've checked your patchset into master.
> > 
> > However, looks like it'd be better to just replace int32 to
> > int64 and avoid problems if GC64.
> 
> Could you please specify which problems you are talking about?
> Current fix simply prevents from overflow, so it does not
> introduce any other problems. Meanwhile users who ref single
> error more than 2^32 times are likely doing smth wrong so
> Lua error notifying them aboit it is a good practice IMHO.

I'd avoid work 'likely' when it is possible. Vlad's approach
allows to do that: it will work always, wherever user doing
something right or wrong, it will just work.

BTW, we are close to start off adopotion of GC64 (w/ ujit or on
vanilla luajit), so ref error 2 billions times doesn't look
impossible.

--
Regards, Kirill Yukhin


More information about the Tarantool-patches mailing list