net.box: make `on_schema_reload` behave the same way as `on_disconnect`
For the `on_connect` trigger, if the trigger execution fails and an exception happens, the connection is terminated and its state changes to 'error'. It allows the following filtering semantic: the client checked some condition from the trigger and decided that the connection does not suite him — the exception is thrown to indicate that the connection should be terminated. Currently, the `on_schema_reload` trigger behaves the same way. However, filtering a connection from the `on_schema_reload` trigger or waiting for a schema update does not seem has neither a reasonable semantic, nor a valid use case. Let's make the `on_schema_reload` trigger behave the same way as the `on_disconnect` trigger, i.e, log the exception, but otherwise ignore it. Closes #9679 @TarantoolBot document Title: `on_schema_reload` trigger of `net.box` connections behaviour update Product: Tarantool Since: 3.1 Root documents: https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_schema_reload When an error is thrown from the `on_schema_reload` trigger, it now behaves the same way as the `on_disconnect` trigger [^1]: > If the trigger function causes an error, the error is logged but otherwise is ignored. [^1]: https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect (cherry picked from commit bbd8b684)
Showing
- changelogs/unreleased/gh-9679-on_schema_reload-error-behaviour.md 5 additions, 0 deletions...gs/unreleased/gh-9679-on_schema_reload-error-behaviour.md
- src/box/lua/net_box.lua 5 additions, 1 deletionsrc/box/lua/net_box.lua
- test/box-luatest/gh_9679_netbox_on_schema_reload_error_behaviour_test.lua 28 additions, 0 deletions.../gh_9679_netbox_on_schema_reload_error_behaviour_test.lua
Loading
Please register or sign in to comment