- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.8k
in_systemd: always reset cursor before iterating fields #11073
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
base: master
Are you sure you want to change the base?
Conversation
| WalkthroughAdded two resets of the systemd journal data cursor/decompression state in the systemd input plugin and set static libzstd visibility to hidden in the bundled zstd CMake build. Changes
 Sequence Diagram(s)sequenceDiagram
    participant Reader as in_systemd_collect
    participant Journal as sd_journal
    Note over Reader,Journal #EFEFEF: Per-entry processing (new calls highlighted)
    Reader->>Journal: sd_journal_next() / advance to next entry
    Reader->>Journal: sd_journal_restart_data()    -- reset decompression/cursor
    Reader->>Journal: sd_journal_enumerate_data()  -- enumerate fields
    Reader->>Journal: sd_journal_restart_data()    -- ensure fresh enumeration state
    alt field data present
        Journal-->>Reader: field data items
    else no data / end
        Journal-->>Reader: no more fields
    end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes 
 Poem
 Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
 ✅ Passed checks (2 passed)
 ✨ Finishing touches🧪 Generate unit tests (beta)
 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
 🧰 Additional context used🧠 Learnings (4)📚 Learning: 2025-08-31T12:46:11.940ZApplied to files: 
 📚 Learning: 2025-08-29T06:25:02.561ZApplied to files: 
 📚 Learning: 2025-08-29T06:24:44.797ZApplied to files: 
 📚 Learning: 2025-08-29T06:24:55.855ZApplied to files: 
 ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
 🔇 Additional comments (1)
 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. Comment  | 
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
0bd94dd    to
    2a64814      
    Compare
  
    Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
| Added another update to avoid zstd exporting symbols... | 
Fixes #11068
Restart the journal data cursor before enumerating the fields. Recent libsystemd releases require callers to reset the cursor between entries; otherwise the internal decompression context can be reused in an invalid state, which ultimately triggers a crash in ZSTD_freeDDict().
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.
Summary by CodeRabbit