Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input_chunk: ensure returning/compairing FLB_BOOL(#8184) #8201

Closed
wants to merge 1 commit into from

Conversation

nokute78
Copy link
Collaborator

This patch is to


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:

  • [N/A] Example configuration file for the change
  • Debug log output from testing the change
  • 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.

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

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [] Backport to latest stable release.

Debug/Valgrind output

$ valgrind --leak-check=full bin/fluent-bit -i dummy -p samples=1 -o loki
==89377== Memcheck, a memory error detector
==89377== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==89377== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==89377== Command: bin/fluent-bit -i dummy -p samples=1 -o loki
==89377== 
Fluent Bit v2.2.1
* Copyright (C) 2015-2023 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2023/11/18 17:40:35] [ info] [fluent bit] version=2.2.1, commit=281aea0a10, pid=89377
[2023/11/18 17:40:35] [ info] [storage] ver=1.2.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/11/18 17:40:35] [ info] [cmetrics] version=0.6.4
[2023/11/18 17:40:35] [ info] [ctraces ] version=0.3.1
[2023/11/18 17:40:35] [ info] [input:dummy:dummy.0] initializing
[2023/11/18 17:40:35] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2023/11/18 17:40:36] [ info] [output:loki:loki.0] configured, hostname=127.0.0.1:3100
[2023/11/18 17:40:36] [ info] [sp] stream processor started
^C[2023/11/18 17:40:40] [engine] caught signal (SIGINT)
[2023/11/18 17:40:40] [ warn] [engine] service will shutdown in max 5 seconds
[2023/11/18 17:40:40] [ info] [input] pausing dummy.0
[2023/11/18 17:40:41] [ info] [engine] service has stopped (0 pending tasks)
[2023/11/18 17:40:41] [ info] [input] pausing dummy.0
==89377== 
==89377== HEAP SUMMARY:
==89377==     in use at exit: 0 bytes in 0 blocks
==89377==   total heap usage: 1,686 allocs, 1,686 frees, 887,889 bytes allocated
==89377== 
==89377== All heap blocks were freed -- no leaks are possible
==89377== 
==89377== For lists of detected and suppressed errors, rerun with: -s
==89377== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Output of nc- l 3100
In issue #8184, values is blank array.

$ nc -l 3100
POST /loki/api/v1/push HTTP/1.1
Host: 127.0.0.1:3100
Content-Length: 106
User-Agent: Fluent-Bit
Content-Type: application/json
Connection: keep-alive

{"streams":[{"stream":{"job":"fluent-bit"},"values":[["1700297119512551798","{\"message\":\"dummy\"}"]]}]}

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.

@nokute78
Copy link
Collaborator Author

Windows CI reported an error.
However it was not related this PR.

      Start 31: flb-it-log
31/42 Test #31: flb-it-log .......................***Failed   20.23 sec
Test cache_basic_timeout...                     
------------------------
[ FAILED ]
  log.c:16: Check (*interval >= timeout - 1) && *interval <= timeout... failed
    interval error. got=3 expect=4-5
  log.c:92: Check ret == 0... failed
    update_and_check_interval for TEST_RECORD_01 failed. i=9
  log.c:16: Check (*interval >= timeout - 1) && *interval <= timeout... failed
    interval error. got=3 expect=4-5
  log.c:98: Check ret == 0... failed
    update_and_check_interval for TEST_RECORD_02 failed. i=9
Test cache_one_slot...                          
[ OK ]
FAILED: 1 of 2 unit tests has failed.

@nokute78
Copy link
Collaborator Author

I think #8182 will be fixed by this PR.

@nokute78
Copy link
Collaborator Author

nokute78 commented Nov 18, 2023

Note:

ret is a return value of

  • v2.2.0
    • flb_input_chunk_is_up that is a wrapper of cio_chunk_is_up. Code
    • CIO_TRUE or CIO_FALSE
  • v2.1.10
    • flb_input_chunk_write that is a wrapper of cio_chunk_write. Code
    • 0 or -1
    • Note: It is removed on v2.2.0 by ac4ec1f

These return values are compared to CIO_OK that is 0. Code
On the other hand, CIO_TRUE is !0. Code

@nokute78
Copy link
Collaborator Author

@edsiper @leonardo-albertovich Could you check this ?
out_loki is broken on v2.2.0 and master. This patch is to fix it.

@nokute78
Copy link
Collaborator Author

User reported a new issue.
#8212

@nokute78
Copy link
Collaborator Author

nokute78 commented Dec 3, 2023

#8184 is fixed by 1a8dd39 of #8223
So, I close this PR.

@nokute78 nokute78 closed this Dec 3, 2023
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.

2 participants