• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 8803598316
86%
master: 88%

Build:
Build:
LAST BUILD BRANCH: ninarodicova/grants
DEFAULT BRANCH: master
Ran 23 Apr 2024 04:20PM UTC
Jobs 1
Files 479
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Apr 2024 04:03PM UTC coverage: 85.792% (+0.01%) from 85.781%
8803598316

push

github

locker
netbox: close transport after stopping worker loop and wait for the stop

Currently, we close the transport from transport from
`luaT_netbox_transport_stop`, and we do not wait for the worker fiber to
stop. This causes several problems.

Firstly, the worker can switch context by yielding (`coio_wait`) or
entering the Lua VM (`netbox_on_state_change`). During a context switch,
the connection can get closed. When the connection is closed, its receive
buffer is reset. If there was some pending response that was partially
retrieved (e.g., a large select), then after resetting the buffer we will
read some inconsistent data. We must not allow this to happen, so let's
check for this case after returning from places where the worker can switch
context. In between closing the connection and cancelling the connection's
worker, an `on_disconnect` trigger can be called, which, in turn, can
also yield, returning control to the worker before it gets cancelled.

Secondly, when the worker enters the Lua VM, garbage collection can be
triggered and the connection owning the worker could get closed
unexpectedly to the worker.

The fundamental source of these problems is that we close the transport
before the worker's loop stops. Instead, we should close it after the
worker's loop stops. In `luaT_netbox_transport_stop`, we should only cancel
the worker, and either wait for the worker to stop, if we are not executing
on it, or otherwise throw an exception (`luaL_testcancel`) to stop the
worker's loop. The user will still have the opportunity to catch this
exception and prevent stoppage of the worker at his own risk. To safeguard
from this scenario, we will now keep the `is_closing` flag enabled once
`luaT_netbox_transport_stop` is called and never disable it.

There also still remains a special case of the connection getting garbage
collected, when it is impossible to stop the worker's loop, since we cannot
join the worker (yielding is forbidden from finalizers), and an e... (continued)

62578 of 113804 branches covered (54.99%)

15 of 15 new or added lines in 1 file covered. (100.0%)

15 existing lines in 7 files now uncovered.

93450 of 108926 relevant lines covered (85.79%)

2451829.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8803598316.1 23 Apr 2024 04:20PM UTC 0
85.79
GitHub Action Run
Source Files on build 8803598316
Detailed source file information is not available for this build.
  • Back to Repo
  • c4c022e2 on github
  • Prev Build on release/2.11 (#8754708723)
  • Next Build on release/2.11 (#8833578456)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc