Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: babinoleg@mail.ru, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] tuple: hide internal functions from box.tuple.*
Date: Mon, 16 Mar 2020 13:15:45 +0000	[thread overview]
Message-ID: <20200316131545.GC14628@tarantool.org> (raw)
In-Reply-To: <c512e905250ba1dab1499429aa4c8e81a32e9cae.1581790002.git.v.shpilevoy@tarantool.org>

On 15 Feb 19:08, Vladislav Shpilevoy wrote:
> box.tuple.bless, .encode, and .is are internal. Their
> behaviour is not documented, and they may omit some checks for the
> sake of speed, and can crash if used without thinking.
> 
> Nonetheless, despite they are not documented, curious users could
> notice them in box.tuple.* output via autocompletion, for example.
> And they could try to use them. This is not ok.
> 
> box.tuple.bless() being called by a user leads either to a crash,
> or to a leak (because it is basically tuple reference counter
> increment).
> 
> box.tuple.encode() is kind of a wrapper around msgpack, and users
> should not touch it. It may change, may be removed. And is just
> makes no sense except some rare cases in schema.lua.
> 
> bless() and encode() were used in schema.lua only, so the patch
> simply moves them to box.internal.tuple.
> 
> box.tuple.is() is kept as is, because
> - this is used in the tests a lot;
> - it is totally safe;
> - that function actually makes sense, and some users could have
>   already started using it.
> 
> There is no a test, since nothing to test - bless() is not
> available for users anymore (assuming no one is brave enough to
> rely on box.internal).

LGTM

  reply	other threads:[~2020-03-16 13:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-15 18:08 [Tarantool-patches] [PATCH 0/2] box.tuple.* cleanup Vladislav Shpilevoy
2020-02-15 18:08 ` [Tarantool-patches] [PATCH 1/2] tuple: hide internal functions from box.tuple.* Vladislav Shpilevoy
2020-03-16 13:15   ` Nikita Pettik [this message]
2020-02-15 18:08 ` [Tarantool-patches] [PATCH 2/2] tuple: make box.tuple.is() public Vladislav Shpilevoy
2020-02-16 15:07   ` Vladislav Shpilevoy
2020-02-17 20:21     ` Oleg Babin
2020-02-17 21:11       ` Vladislav Shpilevoy
2020-03-16 13:19   ` Nikita Pettik
2020-02-15 19:02 ` [Tarantool-patches] [PATCH 0/2] box.tuple.* cleanup Oleg Babin
2020-02-16 15:07 ` Vladislav Shpilevoy
2020-03-01 14:21 ` Igor Munkin
2020-03-15 17:42 ` Vladislav Shpilevoy
2020-03-15 22:38   ` Nikita Pettik
2020-03-16 14:07 ` Kirill Yukhin
2020-03-16 17:48   ` Nikita Pettik

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=20200316131545.GC14628@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=babinoleg@mail.ru \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] tuple: hide internal functions from box.tuple.*' \
    /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