Skip to content

[Canary] lib: monkey: Import afunix patched bundled canary commit of libevent#11829

Draft
cosmo0920 wants to merge 1 commit into
masterfrom
cosmo0920-canary-libevent-monkey-afunix-socketpair-patch-on-windows
Draft

[Canary] lib: monkey: Import afunix patched bundled canary commit of libevent#11829
cosmo0920 wants to merge 1 commit into
masterfrom
cosmo0920-canary-libevent-monkey-afunix-socketpair-patch-on-windows

Conversation

@cosmo0920
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 commented May 20, 2026

THIS IS CANARY PR. DO NOT MERGE.

With this importing AF_UNIX patch on libevent, we can completely eliminate the usages of tcp lookbacked socketpair in libevent's event system in Windows.
monkey/monkey#439

The previous canary still has some of the usages of local loopbacks but in this PR, there's no listeners of local loopback except for explicitly listening addresses.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
PS>bin/fluent-bit -i dummy -o stdout -H -P 2021 -v
  • Debug log output from testing the change
Fluent Bit v5.0.6
* Copyright (C) 2015-2026 The Fluent Bit Authors
* Fluent Bit is a CNCF graduated project under the Fluent organization
* https://fluentbit.io

______ _                  _    ______ _ _           _____  _____
|  ___| |                | |   | ___ (_) |         |  ___||  _  |
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   _|___ \ | |/' |
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \|  /| |
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V //\__/ /\ |_/ /
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)\___/


[2026/05/20 14:41:34.376] [ info] Configuration:
[2026/05/20 14:41:34.377] [ info]  flush time     | 1.000000 seconds
[2026/05/20 14:41:34.377] [ info]  grace          | 5 seconds
[2026/05/20 14:41:34.377] [ info]  daemon         | 0
[2026/05/20 14:41:34.377] [ info] ___________
[2026/05/20 14:41:34.377] [ info]  inputs:
[2026/05/20 14:41:34.377] [ info]      dummy
[2026/05/20 14:41:34.377] [ info] ___________
[2026/05/20 14:41:34.377] [ info]  filters:
[2026/05/20 14:41:34.377] [ info] ___________
[2026/05/20 14:41:34.377] [ info]  outputs:
[2026/05/20 14:41:34.377] [ info]      stdout.0
[2026/05/20 14:41:34.377] [ info] ___________
[2026/05/20 14:41:34.377] [ info]  collectors:
[2026/05/20 14:41:34.380] [ info] [fluent bit] version=5.0.6, commit=da72511d82, pid=14056
[2026/05/20 14:41:34.380] [debug] [engine] maxstdio set: 512
[2026/05/20 14:41:34.380] [debug] [engine] coroutine stack size: 98302 bytes (96.0K)
[2026/05/20 14:41:34.382] [ info] [storage] ver=1.5.4, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2026/05/20 14:41:34.382] [ info] [simd    ] disabled
[2026/05/20 14:41:34.382] [ info] [cmetrics] version=2.1.4
[2026/05/20 14:41:34.382] [ info] [ctraces ] version=0.7.1
[2026/05/20 14:41:34.383] [ info] [input:dummy:dummy.0] initializing
[2026/05/20 14:41:34.383] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2026/05/20 14:41:34.383] [debug] [dummy:dummy.0] created event channels: read=1008 write=1020
[2026/05/20 14:41:34.384] [debug] [stdout:stdout.0] created event channels: read=796 write=1036
[2026/05/20 14:41:34.389] [debug] [downstream] listening on 0.0.0.0:2021
[2026/05/20 14:41:34.389] [ info] [http_server] listen iface=0.0.0.0 tcp_port=2021
[2026/05/20 14:41:34.389] [ info] [sp] stream processor started
[2026/05/20 14:41:34.390] [ info] [output:stdout:stdout.0] worker #0 started
[2026/05/20 14:41:34.391] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
[2026/05/20 14:41:36.401] [debug] [task] created task=0000022A60BC5480 id=0 OK
[2026/05/20 14:41:36.401] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.0: [[1779255695.379084400, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:36.401] [debug] [out flush] cb_destroy coro_id=0
[2026/05/20 14:41:36.401] [debug] [task] destroy task=0000022A60BC5480 (task_id=0)
[2026/05/20 14:41:37.385] [debug] [task] created task=0000022A60BC5160 id=0 OK
[0] dummy.0: [[1779255696.401601200, [2026/05/20 14:41:37.385] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
{}], {"message"=>"dummy"}]
[2026/05/20 14:41:37.386] [debug] [out flush] cb_destroy coro_id=1
[2026/05/20 14:41:37.386] [debug] [task] destroy task=0000022A60BC5160 (task_id=0)
[2026/05/20 14:41:38.383] [debug] [task] created task=0000022A60BC5200 id=0 OK
[2026/05/20 14:41:38.383] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.0: [[1779255697.386107300, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:38.383] [debug] [out flush] cb_destroy coro_id=2
[2026/05/20 14:41:38.383] [debug] [task] destroy task=0000022A60BC5200 (task_id=0)
[2026/05/20 14:41:39.392] [debug] [task] created task=0000022A60BC5020 id=0 OK
[0] dummy.0: [[1779255698.383753200, {}], [2026/05/20 14:41:39.392] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
{"message"=>"dummy"}]
[2026/05/20 14:41:39.393] [debug] [out flush] cb_destroy coro_id=3
[2026/05/20 14:41:39.393] [debug] [task] destroy task=0000022A60BC5020 (task_id=0)
[2026/05/20 14:41:40.390] [debug] [task] created task=0000022A60BC4BC0 id=0 OK
[2026/05/20 14:41:40.390] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.0: [[1779255699.393456500, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:40.391] [debug] [out flush] cb_destroy coro_id=4
[2026/05/20 14:41:40.391] [debug] [task] destroy task=0000022A60BC4BC0 (task_id=0)
[2026/05/20 14:41:41.401] [debug] [task] created task=0000022A60BC4BC0 id=0 OK
[2026/05/20 14:41:41.401] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.0: [[1779255700.390931100, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:41.401] [debug] [out flush] cb_destroy coro_id=5
[2026/05/20 14:41:41.401] [debug] [task] destroy task=0000022A60BC4BC0 (task_id=0)
[2026/05/20 14:41:42.383] [debug] [task] created task=0000022A60BC5160 id=0 OK
[2026/05/20 14:41:42.383] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.0: [[1779255701.401284800, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:42.383] [debug] [out flush] cb_destroy coro_id=6
[2026/05/20 14:41:42.383] [debug] [task] destroy task=0000022A60BC5160 (task_id=0)
[2026/05/20 14:41:43.378] [debug] [task] created task=0000022A60BC4BC0 id=0 OK
[0] dummy.0: [[[2026/05/20 14:41:43.378] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
1779255702.383773500, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:43.379] [debug] [out flush] cb_destroy coro_id=7
[2026/05/20 14:41:43.379] [debug] [task] destroy task=0000022A60BC4BC0 (task_id=0)
[2026/05/20 14:41:44.389] [debug] [task] created task=0000022A60BC4F80 id=0 OK
[0] dummy.0: [[1779255703.379145100, {[2026/05/20 14:41:44.389] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
}], {"message"=>"dummy"}]
[2026/05/20 14:41:44.390] [debug] [out flush] cb_destroy coro_id=8
[2026/05/20 14:41:44.390] [debug] [task] destroy task=0000022A60BC4F80 (task_id=0)
[2026/05/20 14:41:45.399] [debug] [task] created task=0000022A60BC4BC0 id=0 OK
[2026/05/20 14:41:45.399] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
[0] dummy.0: [[1779255704.389821400, {}], {"message"=>"dummy"}]
[2026/05/20 14:41:45.399] [debug] [out flush] cb_destroy coro_id=9
[2026/05/20 14:41:45.399] [debug] [task] destroy task=0000022A60BC4BC0 (task_id=0)
[2026/05/20 14:41:45] [engine] caught signal (SIGINT)
[2026/05/20 14:41:46.380] [debug] [task] created task=0000022A60BC4BC0 id=0 OK
[0] dummy.0: [[1779255705.399199600, [2026/05/20 14:41:46.380] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
{}], {"message"=>"dummy"}]
[2026/05/20 14:41:46.381] [debug] [out flush] cb_destroy coro_id=10
[2026/05/20 14:41:46.381] [debug] [task] destroy task=0000022A60BC4BC0 (task_id=0)
[2026/05/20 14:41:46.507] [debug] [task] created task=0000022A60BC4BC0 id=0 OK
[0] dummy.0: [[1779255706.381411500, {[2026/05/20 14:41:46.507] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0
}], [2026/05/20 14:41:46.507] [ warn] [engine] service will shutdown in max 5 seconds
[2026/05/20 14:41:46.507] [debug] [engine] task 0 already scheduled to run, not re-scheduling it.
{[2026/05/20 14:41:46.507] [ info] [engine] pausing all inputs..
"message"=>"[2026/05/20 14:41:46.507] [ info] [input] pausing dummy.0
dummy"}]
[2026/05/20 14:41:46.507] [debug] [out flush] cb_destroy coro_id=11
[2026/05/20 14:41:46.508] [debug] [task] destroy task=0000022A60BC4BC0 (task_id=0)
[2026/05/20 14:41:47.521] [ info] [engine] service has stopped (0 pending tasks)
[2026/05/20 14:41:47.521] [ info] [input] pausing dummy.0
[2026/05/20 14:41:47.521] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2026/05/20 14:41:47.521] [ info] [output:stdout:stdout.0] thread worker #0 stopped

Experiment result

Plus, we got with Get-NetTCPConnection Cmdlet:

PS> Get-NetTCPConnection -OwningProcess <modified fluent-bit pid>

LocalAddress                        LocalPort RemoteAddress                       RemotePort State       AppliedSetting
------------                        --------- -------------                       ---------- -----       --------------
0.0.0.0                             2021      0.0.0.0                             0          Listen
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f24c9db2-f1f2-4296-a932-f74bc66255d9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cosmo0920-canary-libevent-monkey-afunix-socketpair-patch-on-windows

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cosmo0920 cosmo0920 changed the title [Canarylib: monkey: Import afunix patched bundled canary commit of libevent [Canary] lib: monkey: Import afunix patched bundled canary commit of libevent May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant