Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netbox connection state is error instead of closed, if on_disconnect trigger throws exception #9677

Closed
CuriousGeorgiy opened this issue Feb 12, 2024 · 0 comments · Fixed by #9838
Assignees
Labels
2.11 Target is 2.11 and all newer release/master branches bug Something isn't working netbox

Comments

@CuriousGeorgiy
Copy link
Member

CuriousGeorgiy commented Feb 12, 2024

According to the documentation 1:

If the trigger function causes an error, the error is logged but otherwise is ignored.

Steps to reproduce

os.execute('rm -rf *.snap *.xlog *.vylog 512')

nb = require('net.box')

box.cfg{listen = 3301}

conn = nb.connect(3301)
conn:on_disconnect(function()
    error('error')
end)

pcall(function() conn:close() end)

assert(conn:wait_state('closed', 10))

os.exit()

Actual behavior

Assertion failed.

Expected behavior

The script successfully exits.

Footnotes

  1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect

@CuriousGeorgiy CuriousGeorgiy added bug Something isn't working netbox labels Feb 12, 2024
@CuriousGeorgiy CuriousGeorgiy changed the title Netbox connection state not updated when calling on_{dis}connect trigger Netbox connection state not updated when calling an on_{dis}connect trigger that throws exceptions Feb 12, 2024
@CuriousGeorgiy CuriousGeorgiy changed the title Netbox connection state not updated when calling an on_{dis}connect trigger that throws exceptions Netbox connection state not updated when calling an on_{dis}connect trigger that throws exceptions Feb 12, 2024
@CuriousGeorgiy CuriousGeorgiy changed the title Netbox connection state not updated when calling an on_{dis}connect trigger that throws exceptions Netbox connection state not updated if on_{dis}connect trigger throws exceptions Feb 12, 2024
@CuriousGeorgiy CuriousGeorgiy changed the title Netbox connection state not updated if on_{dis}connect trigger throws exceptions Netbox connection state is error instead of closed, if on_disconnect trigger throws exception Mar 18, 2024
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Mar 20, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes tarantool#9677
Closes tarantool#9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Mar 20, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes tarantool#9677
Closes tarantool#9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Mar 23, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes tarantool#9677
Closes tarantool#9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Mar 30, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes tarantool#9677
Closes tarantool#9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect
sergepetrenko pushed a commit that referenced this issue Apr 2, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes #9677
Closes #9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect
@sergepetrenko sergepetrenko added the 2.11 Target is 2.11 and all newer release/master branches label Apr 2, 2024
sergepetrenko pushed a commit to sergepetrenko/tarantool that referenced this issue Apr 2, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes tarantool#9677
Closes tarantool#9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect

(cherry picked from commit 1d6d6a3)
sergepetrenko pushed a commit to sergepetrenko/tarantool that referenced this issue Apr 2, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes tarantool#9677
Closes tarantool#9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect

(cherry picked from commit 1d6d6a3)
sergepetrenko pushed a commit that referenced this issue Apr 3, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes #9677
Closes #9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect

(cherry picked from commit 1d6d6a3)
sergepetrenko pushed a commit that referenced this issue Apr 3, 2024
According to the documentation [1]:
> If the trigger function causes an error, the error is logged but
otherwise is ignored.

However, currently, the `on_disconnect` trigger behaves the same way as the
`on_connect` trigger, i.e., the connection is terminated and its state
changes to 'error'. Let's fix this inconsistency and log errors from the
`on_disconnect` trigger, but otherwise ignore them.

Closes #9677
Closes #9797

NO_DOC=<bugfix>

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.on_disconnect

(cherry picked from commit 1d6d6a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.11 Target is 2.11 and all newer release/master branches bug Something isn't working netbox
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants