Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH 1/1] session: deprecate box.session.push() 'sync'
@ 2020-05-04 21:43 Vladislav Shpilevoy
  2020-05-18  8:45 ` Kirill Yukhin
  0 siblings, 1 reply; 2+ messages in thread
From: Vladislav Shpilevoy @ 2020-05-04 21:43 UTC (permalink / raw)
  To: tarantool-patches, kyukhin

box.session.push() has two parameters - data to push and 'sync'.
The sync is a request ID with which the out of bound data should
be pushed into a socket.

This was introduced as a workaround for #3450, and is useless
since its resolution.

A user anyway can't push to different sessions, where that
parameter could be useful. And pushing into requests of the same
session, on the contrary, is something not really needed anywhere,
not portable to non-binary session types (console, background),
and is just dangerous since it is easy to add a bug here.

The patch makes the parameter deprecated. Now on its usage there
will be a rate limited warning in the logs.

Part of #4689
---
Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-4689-push-sync-deprecate-2.4
Issue: https://github.com/tarantool/tarantool/issues/4689

The commit is for branch 2.4 only.

 src/box/lua/session.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/box/lua/session.c b/src/box/lua/session.c
index 64453463a..d80e63ece 100644
--- a/src/box/lua/session.c
+++ b/src/box/lua/session.c
@@ -387,6 +387,8 @@ lbox_session_push(struct lua_State *L)
 		sync = luaL_touint64(L, 2);
 		if (sync != 0 || (lua_isnumber(L, 2) &&
 				  lua_tonumber(L, 2) == 0)) {
+			say_warn_ratelimited("box.session.push() 'sync' "
+					     "parameter is deprecated");
 			lua_pop(L, 1);
 			break;
 		}
-- 
2.21.1 (Apple Git-122.3)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Tarantool-patches] [PATCH 1/1] session: deprecate box.session.push() 'sync'
  2020-05-04 21:43 [Tarantool-patches] [PATCH 1/1] session: deprecate box.session.push() 'sync' Vladislav Shpilevoy
@ 2020-05-18  8:45 ` Kirill Yukhin
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill Yukhin @ 2020-05-18  8:45 UTC (permalink / raw)
  To: Vladislav Shpilevoy; +Cc: tarantool-patches

Hello,

On 04 май 23:43, Vladislav Shpilevoy wrote:
> box.session.push() has two parameters - data to push and 'sync'.
> The sync is a request ID with which the out of bound data should
> be pushed into a socket.
> 
> This was introduced as a workaround for #3450, and is useless
> since its resolution.
> 
> A user anyway can't push to different sessions, where that
> parameter could be useful. And pushing into requests of the same
> session, on the contrary, is something not really needed anywhere,
> not portable to non-binary session types (console, background),
> and is just dangerous since it is easy to add a bug here.
> 
> The patch makes the parameter deprecated. Now on its usage there
> will be a rate limited warning in the logs.
> 
> Part of #4689

I've checked your patch into 2.4.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-18  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 21:43 [Tarantool-patches] [PATCH 1/1] session: deprecate box.session.push() 'sync' Vladislav Shpilevoy
2020-05-18  8:45 ` Kirill Yukhin

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