Skip to content

CCDB: Ensure CCDBDownloader's libuv loop is properly deleted - #13238

Merged
knopers8 merged 1 commit into
AliceO2Group:devfrom
knopers8:fix-leak-ccdb-downloader
Jun 21, 2024
Merged

CCDB: Ensure CCDBDownloader's libuv loop is properly deleted#13238
knopers8 merged 1 commit into
AliceO2Group:devfrom
knopers8:fix-leak-ccdb-downloader

Conversation

@knopers8

Copy link
Copy Markdown
Collaborator

My valgrind checks were showing that the internal CCDBDownloader's libuv loop resources were not fully released. With this fix, valgrind is happy.

The change is based on the following premises:

  • uv_loop_alive returns true if there are active handles
  • uv_loop_close returns UV_EBUSY if there are open handles.
  • we need to succesfully call uv_loop_close to clear mUVLoop resources

Thus, in case that we would not have active handles, we would never close open ones, and consequently would not manage to call uv_loop_close without getting UV_EBUSY.

@knopers8
knopers8 requested review from a team, Barthelemy, costing and sawenzel as code owners June 20, 2024 13:51
@github-actions

Copy link
Copy Markdown
Contributor

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass3
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0

My valgrind checks were showing that the internal CCDBDownloader's libuv loop resources were not fully released. With this fix, valgrind is happy.

The change is based on the following premises:
- `uv_loop_alive` returns true if there are *active* handles
- `uv_loop_close` returns `UV_EBUSY` if there are *open* handles.
- we need to succesfully call `uv_loop_close` to clear `mUVLoop` resources

Thus, in case that we would not have *active* handles, we would never close *open* ones, and consequently would not manage to call `uv_loop_close` without getting `UV_EBUSY`.

@ktf ktf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@costing

costing commented Jun 20, 2024

Copy link
Copy Markdown
Collaborator

Thank you @knopers8 ! Informing @TrifleMichael of the change.

@knopers8
knopers8 merged commit 1ff1138 into AliceO2Group:dev Jun 21, 2024
@knopers8
knopers8 deleted the fix-leak-ccdb-downloader branch June 21, 2024 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants