Bug 291680 - blocklistd/blacklistd is keeping sockets open in CLOSED state
Summary: blocklistd/blacklistd is keeping sockets open in CLOSED state
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Jose Luis Duran
URL: https://github.com/zoulasc/blocklist/...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-15 08:53 UTC by Wout Decré
Modified: 2025-12-23 02:34 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wout Decré 2025-12-15 08:53:51 UTC
After upgrading to 15.0-RELEASE I noticed many connections remain in a CLOSED state because blocklistd/blacklistd keeps the fd open.

# netstat -an | grep CLOSED | wc -l
   62254

Restarting blocklistd/blacklistd closes all the connections.

When I revert commit c4f2ac409c98536a97c0ec7e6dbb09f36f2b18ba the problem is fixed.

There seems to be no more call to close(bi->bi_fd).

This was changed by upstream: https://github.com/zoulasc/blocklist/commit/a8a019d60d50b2363a8ad56087ab199a57fb3746
Comment 1 commit-hook freebsd_committer freebsd_triage 2025-12-16 01:11:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=52395203f9ac40d321ed55d93e9887300261d3bf

commit 52395203f9ac40d321ed55d93e9887300261d3bf
Merge: 715cc2571370 bfef098f9249
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-12-16 01:03:30 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-12-16 01:03:30 +0000

    MFV: Import blocklist 2025-12-15 (8a4b011)

    Merge commit 'bfef098f924950a085927b1e7dd6c6db4e651c5c'

    Changes:

    https://github.com/zoulasc/blocklist/compare/ff13526...8a4b011

    PR:             258411
    PR:             291680
    MFC after:      1 week

 contrib/blocklist/bin/blocklistd.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-12-16 08:15:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9c844b6110b3768a4fc3ce47cd9d1b30915213ec

commit 9c844b6110b3768a4fc3ce47cd9d1b30915213ec
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-12-16 07:57:07 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-12-16 08:13:39 +0000

    blocklist: blacklist: Chase recent upstream changes

    Upstream fixed a couple of bugs:

    1. Only attempt to restore the blocking rules if the database file
       exists.  Otherwise, when the service starts for the first time, it
       fails (PR 258411).

    2. Revert a commit that removed a call to close(bi->bi_fd), preventing
       the descriptor from being deleted.

    PR:             258411
    PR:             291680
    MFC after:      1 week

 contrib/blocklist/bin/blacklistd.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-12-23 02:31:39 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=749293292aea9387de68dad931fe757209b66048

commit 749293292aea9387de68dad931fe757209b66048
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-12-16 01:03:30 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-12-23 02:30:03 +0000

    MFV: Import blocklist 2025-12-15 (8a4b011)

    Merge commit 'bfef098f924950a085927b1e7dd6c6db4e651c5c'

    Changes:

    https://github.com/zoulasc/blocklist/compare/ff13526...8a4b011

    PR:             258411
    PR:             291680
    MFC after:      1 week

    (cherry picked from commit 52395203f9ac40d321ed55d93e9887300261d3bf)

 contrib/blocklist/bin/blocklistd.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-12-23 02:31:42 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6edb101740083aa374fa0494ee211bdac38e2c1c

commit 6edb101740083aa374fa0494ee211bdac38e2c1c
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-12-16 07:57:07 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-12-23 02:30:24 +0000

    blocklist: blacklist: Chase recent upstream changes

    Upstream fixed a couple of bugs:

    1. Only attempt to restore the blocking rules if the database file
       exists.  Otherwise, when the service starts for the first time, it
       fails (PR 258411).

    2. Revert a commit that removed a call to close(bi->bi_fd), preventing
       the descriptor from being deleted.

    PR:             258411
    PR:             291680
    MFC after:      1 week

    (cherry picked from commit 9c844b6110b3768a4fc3ce47cd9d1b30915213ec)

 contrib/blocklist/bin/blacklistd.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)
Comment 5 Jose Luis Duran freebsd_committer freebsd_triage 2025-12-23 02:34:32 UTC
Thank you for the bug report!