Cannot change the dummy input Rate parameter on iOS (Mac)
Bug Report
Describe the bug Whether in a command line parameter or a config setting, changing the Rate on the dummy input on Mac causes one and only one message to be generated.
This seems to have been previously noted in https://github.com/fluent/fluent-bit/issues/2801 with no reply.
To Reproduce On Mac OS:
fluent-bit -i dummy -p rate=2 -o stdout
Observe that only one message is generated
Expected behavior Messages would be generated at the rate specified.
Screenshots Please be sure to notice the observation after the second command output, it seems like it could get lost...
This appears to be a bug on Mac OS. I'm running fluent-bit 1.9.6 on Monterey (arm) and this command properly generates the default one message per second:
$ fluent-bit -i dummy -o stdout
Fluent Bit v1.9.6
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2022/07/20 15:54:44] [ info] [fluent bit] version=1.9.6, commit=, pid=4807
[2022/07/20 15:54:44] [ info] [storage] version=1.2.0, type=memory-only, sync=normal, checksum=disabled, max_chunks_up=128
[2022/07/20 15:54:44] [ info] [cmetrics] version=0.3.5
[2022/07/20 15:54:44] [ info] [output:stdout:stdout.0] worker #0 started
[2022/07/20 15:54:44] [ info] [sp] stream processor started
[0] dummy.0: [1658354085.415445000, {"message"=>"dummy"}]
[0] dummy.0: [1658354086.414038000, {"message"=>"dummy"}]
[0] dummy.0: [1658354087.415585000, {"message"=>"dummy"}]
^C[2022/07/20 15:54:49] [engine] caught signal (SIGINT)
[0] dummy.0: [1658354088.416675000, {"message"=>"dummy"}]
[2022/07/20 15:54:49] [ warn] [engine] service will shutdown in max 5 seconds
[2022/07/20 15:54:50] [ info] [engine] service has stopped (0 pending tasks)
[2022/07/20 15:54:50] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2022/07/20 15:54:50] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2022/07/20 15:54:50] [ Error] kevent: No such file or directory, errno=2 at /tmp/fluent-bit-20220715-49542-8kph0p/fluent-bit-1.9.6/lib/monkey/mk_core/mk_event_kqueue.c:151
While any other rate specified causes a single dummy message, then nothing:
$ fluent-bit -i dummy -p rate=2 -o stdout
Fluent Bit v1.9.6
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2022/07/20 15:57:11] [ info] [fluent bit] version=1.9.6, commit=, pid=5108
[2022/07/20 15:57:11] [ info] [storage] version=1.2.0, type=memory-only, sync=normal, checksum=disabled, max_chunks_up=128
[2022/07/20 15:57:11] [ info] [cmetrics] version=0.3.5
[2022/07/20 15:57:11] [ info] [sp] stream processor started
[2022/07/20 15:57:11] [ info] [output:stdout:stdout.0] worker #0 started
[0] dummy.0: [1658354231.986751000, {"message"=>"dummy"}]
<several seconds later>
^C[2022/07/20 15:57:30] [engine] caught signal (SIGINT)
[2022/07/20 15:57:30] [ warn] [engine] service will shutdown in max 5 seconds
[2022/07/20 15:57:31] [ info] [engine] service has stopped (0 pending tasks)
[2022/07/20 15:57:31] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2022/07/20 15:57:31] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2022/07/20 15:57:31] [ Error] kevent: No such file or directory, errno=2 at /tmp/fluent-bit-20220715-49542-8kph0p/fluent-bit-1.9.6/lib/monkey/mk_core/mk_event_kqueue.c:151
NOTE HERE:
Interestingly, specifying -p rate=1 on the command line behaves properly with one message per second.
The same behavior is exhibited when using a config file:
[INPUT]
Name dummy
Tag dummy.log
Rate 30
[FILTER]
Name lua
Match *
Script throttle.lua
Call send_or_dont
[OUTPUT]
Name stdout
$ fluent-bit -c test_config.cfg
Fluent Bit v1.9.6
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2022/07/20 15:59:33] [ info] [fluent bit] version=1.9.6, commit=, pid=5565
[2022/07/20 15:59:33] [ info] [storage] version=1.2.0, type=memory-only, sync=normal, checksum=disabled, max_chunks_up=128
[2022/07/20 15:59:33] [ info] [cmetrics] version=0.3.5
[2022/07/20 15:59:33] [ info] [output:stdout:stdout.0] worker #0 started
[2022/07/20 15:59:33] [ info] [sp] stream processor started
[0] dummy.log: [1658354373.678347000, {"message"=>"dummy"}]
<several seconds later>
^C[2022/07/20 15:59:39] [engine] caught signal (SIGINT)
[2022/07/20 15:59:39] [ warn] [engine] service will shutdown in max 5 seconds
[2022/07/20 15:59:40] [ info] [engine] service has stopped (0 pending tasks)
[2022/07/20 15:59:40] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2022/07/20 15:59:40] [ info] [output:stdout:stdout.0] thread worker #0 stopped
[2022/07/20 15:59:40] [ Error] kevent: No such file or directory, errno=2 at /tmp/fluent-bit-20220715-49542-8kph0p/fluent-bit-1.9.6/lib/monkey/mk_core/mk_event_kqueue.c:151
This is not the behavior I see on Ubuntu:
$ /opt/fluent-bit/bin/fluent-bit --version
Fluent Bit v1.9.6
Git commit:
$ /opt/fluent-bit/bin/fluent-bit -i dummy -p rate=2 -o stdout
Fluent Bit v1.9.6
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2022/07/20 16:07:05] [ info] [fluent bit] version=1.9.6, commit=, pid=1811806
[2022/07/20 16:07:05] [ info] [storage] version=1.2.0, type=memory-only, sync=normal, checksum=disabled, max_chunks_up=128
[2022/07/20 16:07:05] [ info] [cmetrics] version=0.3.5
[2022/07/20 16:07:05] [ info] [sp] stream processor started
[2022/07/20 16:07:05] [ info] [output:stdout:stdout.0] worker #0 started
[0] dummy.0: [1658354825.732224613, {"message"=>"dummy"}]
[0] dummy.0: [1658354825.806136938, {"message"=>"dummy"}]
[1] dummy.0: [1658354826.306101821, {"message"=>"dummy"}]
[0] dummy.0: [1658354826.806155553, {"message"=>"dummy"}]
[1] dummy.0: [1658354827.306095146, {"message"=>"dummy"}]
[0] dummy.0: [1658354827.806117363, {"message"=>"dummy"}]
[1] dummy.0: [1658354828.306089636, {"message"=>"dummy"}]
^C[2022/07/20 16:07:09] [engine] caught signal (SIGINT)
[0] dummy.0: [1658354828.806123869, {"message"=>"dummy"}]
[1] dummy.0: [1658354829.306093434, {"message"=>"dummy"}]
[2022/07/20 16:07:09] [ warn] [engine] service will shutdown in max 5 seconds
[2022/07/20 16:07:09] [ info] [engine] service has stopped (0 pending tasks)
[2022/07/20 16:07:09] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2022/07/20 16:07:09] [ info] [output:stdout:stdout.0] thread worker #0 stopped
Your Environment
- Version used: 1.9.6
- Configuration: see above
- Environment name and version (e.g. Kubernetes? What version?): command line or bare config
- Server type and version: M1 Macbook Pro
- Operating System and version: Monterey, 12.4
- Filters and plugins: dummy
Additional context Testing on local dev host
@cosmo0920 has already resolved this @brunson on the master branch: https://github.com/fluent/fluent-bit/commit/9acb68b3075a6779bdff635d13a0a343addb6b68
Can you try that to check it resolves it for you?
It may need backporting to the 1.9 branch based on https://github.com/fluent/fluent-bit/pull/5756 so please submit a PR if you can.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.
This issue was closed because it has been stalled for 5 days with no activity.