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

tarantool / tarantool / 22138316681

18 Feb 2026 11:42AM UTC coverage: 87.644% (-0.009%) from 87.653%
22138316681

push

github

locker
box: destroy fiber pool before returning from application thread

fiber_pool_destroy() doesn't destroy the underlying endpoint, neither
does it remove idle fibers from the idle fiber list. This is done by
fiber_pool_shutdown(), but we can't call it from app_thread_f because it
requires a running event loop. If we don't remove the endpoint from
the global list, Tarantool can crash while destroying other endpoints,
for example the applier's endpoint:

```
 #1  0x593501a3fd1f in crash_collect+256
 #2  0x593501a4075b in crash_signal_cb+100
 #3  0x7d8c74045330 in __sigaction+80
 #4  0x593501a54aed in cbus_endpoint_destroy+337
 #5  0x5935019010f7 in applier_thread_f(__va_list_tag*)+412
 #6  0x59350177211c in fiber_cxx_invoke(int (*)(__va_list_tag*), __va_list_tag*)+34
 #7  0x593501a4beb9 in fiber_loop+219
 #8  0x593501e29214 in coro_init+118
```

If we don't remove idle fibers from the idle fiber list, Tarantool can
crash while destroying all fibers when the cord is stopped:

```
 #1  0x5f9fee9486c9 in crash_collect+1945
 #2  0x5f9fee947e07 in crash_signal_cb+279
 #3  0x7b0c2e045330 in __sigaction+80
 #4  0x5f9fee97a242 in fiber_destroy+818
 #5  0x5f9fee9796b2 in fiber_delete+162
 #6  0x5f9fee972878 in cord_delete_fibers_in_list+584
 #7  0x5f9fee9725a4 in fiber_delete_all+84
 #8  0x5f9fee979bd7 in cord_destroy+903
 #9  0x5f9fee97ee49 in cord_join+2521
 #10 0x5f9fedca92b1 in app_threads_stop+81
 #11 0x5f9fee310fe5 in box_storage_shutdown()+181
 #12 0x5f9fee310f26 in box_shutdown+150
 #13 0x5f9fedc98760 in on_shutdown_f(__va_list_tag*)+560
 #14 0x5f9fedc9649a in fiber_cxx_invoke(int (*)(__va_list_tag*), __va_list_tag*)+26
 #15 0x5f9fee96f490 in fiber_loop+1056
 #16 0x5f9fef5ecad4 in coro_init+276
```

Let's destroy the fiber pool directly. This is a quick ugly fix.
We should rework the fiber pool shutdown mechanism in future instead.

Follow-up commit af99552bec9c9 ("box: introduce application threads").

NO_DOC=unreleased
NO_CHANGELOG=unreleased
NO_TEST=caug... (continued)

70438 of 118519 branches covered (59.43%)

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

198 existing lines in 15 files now uncovered.

105949 of 120885 relevant lines covered (87.64%)

1396627.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.45
/src/lua/utils.c


Source Not Available

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