Skip to content

btrfs collector does not close file handles in a timely manner, which prevents unmounting #2772

@hhoffstaette

Description

@hhoffstaette

Host operating system: output of uname -a

Gentoo with kernel 6.4.10:
Linux tux 6.4.10 #1 SMP Wed Aug 9 16:27:28 CEST 2023 x86_64 Intel(R) Core(TM) i5-2400S CPU @ 2.50GHz GenuineIntel GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 1.6.0 (branch: non-git, revision: ff7f9d6)
build user: portage@localhost
build date: 20230807-19:11:32
go version: go1.20.7
platform: linux/amd64
tags: netgo osusergo static_build

node_exporter command line flags

btrfs collector is enabled :)

node_exporter log output

none

Are you running node_exporter in Docker?

no

What did you do that produced an error?

$mount /mnt/archive 
-> the mount worked and we wait one or two polling intervals

$umount /mnt/archive
umount: /mnt/archive: target is busy.
-> :(

$lsof | grep /mnt/archive
node_expo 20168                     node_exporter   12r      DIR               0,40       122        256 /mnt/archive
node_expo 20168 20171 node_expo     node_exporter   12r      DIR               0,40       122        256 /mnt/archive
node_expo 20168 20172 node_expo     node_exporter   12r      DIR               0,40       122        256 /mnt/archive
node_expo 20168 20190 node_expo     node_exporter   12r      DIR               0,40       122        256 /mnt/archive

$pwd
/root
-> $pwd is not on the mount point, so unmount should have worked
-> restart node_exporter:

$/etc/init.d/node_exporter restart
 * Stopping node_exporter ...                                                 [ ok ]
 * Starting node_exporter ...                                                 [ ok ]

$umount /mnt/archive
-> success!

What did you expect to see?

Working unmount without having to restart node_exporter

What did you see instead?

Unmount not working

Additional observation

This behaviour is 100% repeatable and does not resolve itself over time.

Edit: apparently it does resolve itself over time, as long as the GC is triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions