19082 Commits

Author SHA1 Message Date
xietangxin
dc561451d7 imjournal: fix double sd_journal_close() during thread cancellation
When the main thread cancel imjournal thread, the thread exits without
setting sd_journal to NULL because sd_journal_close() contain cancel point.
This leads to a double free scenario where:

1. The thread cancel occurs during sd_journal_close()
2. The main thread then calls imjournal's afterrun function
3. sd_journal_close() is called again on the already-freed sd_journal
2025-08-18 20:14:09 +08:00
Rainer Gerhards
12e4ec6655
Merge pull request #5967 from rgerhards/nitfix
fix typo
2025-08-18 14:08:52 +02:00
Rainer Gerhards
afb21d985d
Merge pull request #5969 from rgerhards/upd-commit
docs: streamline contrib templates and commit guidance
2025-08-18 14:05:26 +02:00
0a5de996e1
Merge pull request #5950 from rsyslog/cursor/migrate-omhttp-to-omodtx-committransaction-interface-567d
Migrate omhttp to OMODTX commitTransaction interface [GPT5]
2025-08-18 14:01:05 +02:00
Rainer Gerhards
97c7c68f5c
docs: streamline contrib templates and commit guidance
This modernizes contributor experience by simplifying PR templates and
removing the lengthy GDPR disclaimer that often discouraged or confused
new contributors. The update encourages more participation and shows how
responsible AI can be used to improve open source workflows.

Impact: none on runtime behavior; contributor workflow improved.

Before: PR template included long GDPR block; commit message rules were
scattered and partly implicit.
After: PR template is concise, GDPR text removed, and commit assistant
usage is documented across README, CONTRIBUTING, and AGENTS.md.

Technical changes include:
- PR template: drop GDPR notice, add commit-assistant references.
- CONTRIBUTING.md: add explicit commit rules and workflow guidance.
- AGENTS.md: require canonical base prompt and commit-first workflow.
- README.md: point to assistant and updated guidance.
- base_prompt.txt: enforce "Findings:" colon format.
- Minor formatting corrections in comments.
2025-08-18 13:59:53 +02:00
Rainer Gerhards
b76eb6d3b0
Merge pull request #5968 from rgerhards/rsyslog-commit-assistant
ai: add base prompt for commit assistant
2025-08-18 12:59:50 +02:00
Rainer Gerhards
828b2a3be1
ai: add base prompt for commit assistant
This introduces the first building block of our "responsible AI First"
approach. The base prompt defines how the rsyslog commit assistant
supports contributors in crafting consistent, high-quality commit
messages, thereby lowering entry barriers and improving project-wide
quality.

Impact: contributor workflow only, no runtime effect.

Technically this adds a structured prompt file under
ai/rsyslog_commit_assistant/. It codifies message format, workflow
checks, and error handling guidance. No rsyslog core code, config, or
tests are affected. This is a purely contributor-facing addition that
can evolve independently of runtime behavior.

Refs: https://www.rsyslog.com/clarifying-ai-first-what-it-really-means-for-rsyslog/
2025-08-18 12:33:54 +02:00
Cursor Agent
2db66bcb9d
omhttp: migrate to OMODTX; prep for project-supported status
Why: Modernize omhttp so HTTP forwarding is viable and maintainable in
current deployments (incl. Docker). Align the module with core-supported
interfaces, reduce maintenance risk, and pave the way to promote it from
contrib to an officially supported module.

Technical overview (conceptual):
- Switch plugin API from legacy TXIF (doAction) to OMODTX
  (commitTransaction). Update query entry points accordingly.
- Keep beginTransaction for batch init; fold the final flush from
  endTransaction into commitTransaction per OMODTX.
- Preserve external behavior: batching thresholds (maxBatchSize and
  maxBatchBytes), dynRestPath handling, statistics, and HUP behavior.
- In commitTransaction, process all records in one pass and submit
  batches when thresholds are crossed; non-batch mode posts per record.
- Retry test adjusted to tolerate duplicates during migration
  (omhttp-retry.sh), reflecting current OMODTX replay characteristics.

Addresses from #5957:
- Core modernization of omhttp to the project’s current module
  interface, suitable for containerized use cases.
- First step toward “project-supported” status by aligning with the
  supported core API and updating tests.

Planned follow-ups (separate commits):
- Fix dynRestPath after a batch flush (set new path right after
  initializeBatch).
- Revisit commit/replay semantics to minimize duplicates under retry, or
  document dup-tolerant behavior and test both modes.
- Verify and free batch.restPath and headerBuf; add focused tests (path
  change mid-batch, maxBatchBytes edges, TLS/gzip, HUP reinit).
- Documentation and packaging steps required for “project-supported”
  status (module docs, release notes, CI/packaging policy).
- Evaluate if a compatibility query hook is needed for older cores.

see also: https://github.com/rsyslog/rsyslog/issues/5957
2025-08-18 10:58:57 +02:00
Rainer Gerhards
a25ccfdf0f
fix typo 2025-08-18 09:45:27 +02:00
Rainer Gerhards
fa3bf2ae61
docs: split imfile module parameters (#5941)
With help of AI-Agent: ChatGPT
2025-08-18 09:34:35 +02:00
Rainer Gerhards
bdb6a64b82
Merge pull request #5961 from rsyslog/codex/refactor-module-name-documentation
imptcp: split parameter docs into reference pages
2025-08-18 09:06:58 +02:00
Rainer Gerhards
c7c57f0173 serialize TLS session setup to avoid data race
tcpflood opens TLS connections in parallel. OpenSSL updates internal X509 structures during the handshake, which leads ThreadSanitizer to report races when multiple handshakes run concurrently. Protect the handshake with a mutex and guard the error counter with its own lock.

AI-Agent: ChatGPT
2025-08-18 08:53:30 +02:00
Rainer Gerhards
d0a0305028
imptcp: split parameter docs into reference pages
Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
2025-08-18 08:42:46 +02:00
Rainer Gerhards
c912509f7c
doc: add per-container docker pages with env defaults (#5960)
Improve rsyslog docker container documentation by describing the user-facing containers and their settings.
2025-08-17 15:20:21 +02:00
Rainer Gerhards
7c4f22c166
Merge pull request #5959 from rsyslog/codex/review-and-update-container-documentation
docs: update containers overview for new Docker images
2025-08-17 13:22:30 +02:00
Rainer Gerhards
78bd61d23a
docs: rewrite container section with current images
replace outdated container docs with descriptions of user-focused images and development/CI containers; update install instructions to point to new content.

AI-Agent: ChatGPT
2025-08-17 13:18:45 +02:00
Rainer Gerhards
5354b3087c
Merge pull request #5956 from rgerhards/canonical
doc: set html_baseurl to emit canonical tags
2025-08-16 13:00:18 +02:00
Rainer Gerhards
d1a05cd658
Update doc/source/conf.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-16 12:55:41 +02:00
Rainer Gerhards
c81669240f
doc: set html_baseurl to emit canonical tags
Add html_baseurl to Sphinx config; set to
'https://www.rsyslog.com/doc/'.
Sphinx will add a canonical link per page, reducing duplicate
content in search and consolidating ranking.

The URL matches the production docs root (trailing slash kept). No
behavior change for local/offline builds.
2025-08-16 12:51:33 +02:00
Rainer Gerhards
10604273a6
Merge pull request #5953 from rgerhards/warn-unofficial
doc: warn against unofficial and outdated doc clones
2025-08-16 10:44:16 +02:00
Rainer Gerhards
1b56b8e0de
doc: warn against unofficial and outdated doc clones
These cause mayor confusion for rsyslog users. Ensure they know
the need to go to the source.

This is probabaly only an interim solution until we have found
better ways to address the core issue.
2025-08-16 10:18:04 +02:00
Rainer Gerhards
1a6ae9bfae
Merge pull request #5952 from rgerhards/doc-omkafka-env
doc: omkafka SASL-from-env example + backticks doc overhaul
2025-08-16 10:05:25 +02:00
Rainer Gerhards
135f2c08b3
doc: omkafka SASL-from-env example + backticks doc overhaul
- omkafka.rst: add “Set SASL password from an environment variable”
  section with two paths:
  * v8.2508.0+: inline `${VAR}` with adjacency via backticks
    (`echo sasl.password=${KAFKA_PASSWORD}`)
  * pre-8.2508.0: pre-compose `SASL_PWDPARAM` and echo that
- Clarify security notes (env files, /proc visibility) and add anchor
  label :ref:`omkafka-sasl-password-from-env`
- constant_strings.rst: restructure and expand
  * document `${VAR}` support, unbraced `$VAR` termination rules, and
    adjacency to static text (v8.2508.0)
  * keep scope explicit: only `echo`/`cat`, no `$(...)`
  * add clear examples and use `rsyslog` lexer for code blocks
  * add compatibility guidance for older versions
  * add note: backticks can toggle boolean flags such as `config.enabled`
- Motivation: addresses confusion seen in omkafka SASL cases (e.g. #5827)

No behavioral changes to code; documentation only.
2025-08-16 10:01:53 +02:00
Rainer Gerhards
84491efd81
Merge pull request #5945 from alorbach/pr-issue-2420-final
Fix transaction suspension handling
2025-08-15 20:16:01 +02:00
Rainer Gerhards
5c461921a6
maintain ChangeLog 2025-08-15 17:11:38 +02:00
Rainer Gerhards
99f70c1a5a
Merge pull request #5832 from rsyslog/codex/analyze-and-implement-feature-from-issue-5830
Enhance backticks with ${VAR} support
2025-08-15 17:09:12 +02:00
Rainer Gerhards
a57e4ec63d
Merge pull request #5951 from rsyslog/codex/refactor-rsyslog-parameter-documentation
imtcp: split parameter docs into reference pages
2025-08-15 16:18:00 +02:00
Rainer Gerhards
89b8acf301
imtcp: fix parameter scopes and add input examples
- remove duplicate case-insensitivity note\n- clarify AddtlFrameDelimiter description\n- document module+input scope and usage for flowControl, keepAlive, and related parameters\n\nAI-Agent: ChatGPT
2025-08-15 16:09:31 +02:00
Rainer Gerhards
5fea5070a4
Update tests/omprog-feedback.sh
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-15 16:04:47 +02:00
Rainer Gerhards
13ca403ea0
rainerscript: backticks support ${VAR} and adjacent text
This implements brace-style env vars inside backticks with `echo` and
fixes termination of unbraced `$VAR`. Most importantly, variables can
now be adjacent to static text (e.g., `foo${ENV}bar`), which previously
did not work and caused confusion. This aligns behavior with common
bash expectations.

Why
- Users expect `${VAR}` and `$VAR!` to expand while keeping punctuation.
- Concatenations like `foo${ENV}bar` are common and should be valid.

What
- Add support for braced variables `${VAR}` with proper `}` handling.
- For unbraced `$VAR`, stop the name at the first non `[A-Za-z0-9_]`
  char and emit that char (e.g., `!`, `.`) as literal output.
- Improve error handling for overlong env var names.
- Keep other shell features (e.g., `$(pwd)`) unsupported by design.

Docs
- Update `constant_strings.rst` to document `${VAR}`, the new
  termination rules, and examples including `foo${ENV}bar` and `$VAR!`.

Tests
- Add `rscript_backticks_braces_envvar.sh` for `${VAR}` support.
- Add `rscript_backticks_static_text.sh` for `$VAR!` and adjacency.
- Convert `rscript_backticks_empty_envvar-vg.sh` to non-VG variant and
  adjust `tests/Makefile.am`.

Compatibility
- Backward compatible. Changes affect only previously broken edge cases.

Misc
- Refresh lexer copyright years.
2025-08-15 14:43:41 +02:00
19ae11b869 Fix transaction suspension handling for issue #2420
- action.c: Add iSuspended flag to prevent infinite loops when transactions
  are suspended multiple times. Retry on first suspension
  and abort with RS_RET_SUSPENDED on subsequent suspensions.

- tests/omprog-transactions-failed-messages.sh: Remove TODO comment and
  workaround code related to issue #2420 (deferred messages within
  transactions not being retried), as the underlying issue appears to
  be resolved.

- tests/omprog-feedback-timeout.sh: Update expected output to reflect
  improved transaction handling behavior. The test now expects additional
  message processing cycles and proper timeout handling when the omprog
  action is suspended and restarted.

- tests/omprog-feedback.sh: Make robust against timing variations from
  new action.c retry logic by replacing exact sequence matching with
  pattern-based validation to ensure cross-system compatibility.

- tests/omhttp-retry-timeout.sh: Optimize test parameters for better
  reliability by reducing message count from 10000 to 5000, adding
  sequence check options, and reducing queue batch size from 2048 to 500
  to prevent test timeouts and improve stability.

- omhttp-batch-fail-with-400.sh test: resolve queue growth issue with
  HTTP 400 errors. The test was experiencing a queue growth issue where
  the queue size was increasing. This was caused by the omhttp module
  incorrectly treating HTTP 400 errors as retriable when they should be
  treated as permanent failures.
  FIX: Added httpretrycodes=["500", "502", "503", "504"] configuration.
  This explicitly specifies that only 5xx server errors should be retried.
  HTTP 400 errors are now properly treated as permanent failures.

Some tests needed to be adapted, because they expected an "exactly once"
paradigm, which the fixed bug seemed to provide in some cases (but not
reliably). Actually, rsyslog guarantees "at least once", so duplicates
can occur and are typical if transaction-like logic is used with
non-transactional outputs.

This addresses the transaction suspension edge case and cleans up
temporary workaround code that is no longer needed. The test updates
ensure that the improved transaction handling behavior is properly
validated across different scenarios and that tests correctly reflect
rsyslog's actual delivery semantics.

closes https://github.com/rsyslog/rsyslog/issues/2420
2025-08-15 14:28:34 +02:00
Rainer Gerhards
19966b728b imtcp: split input parameter docs into reference pages 2025-08-15 14:27:05 +02:00
Rainer Gerhards
323a7e41a7
Merge pull request #5944 from rgerhards/diag-srcdir
testbench fix: $srcdir was not always exported
2025-08-15 10:49:46 +02:00
Rainer Gerhards
2966121fb6
testbench fix: $srcdir was not always exported
If the srcdir variable was not defined, all tests initialize it
to ".". While this is fine, if srcdrv was not previously exported
the newly set variable was local to the execution shell and did
not promote to rsyslog environment.

However, srcdir is granted to be in environment, many processes
in testbench depend on this. We now ensure this by doing an
explicit export of srcdir during script init phase.
2025-08-15 09:29:42 +02:00
Rainer Gerhards
ee1ae06080
Merge pull request #5932 from rsyslog/codex/fix-reverse-dns-cache-ttl-issues
doc: clarify reverse DNS cache TTL parameters
2025-08-14 14:07:18 +02:00
Rainer Gerhards
e6cd243d19
Merge pull request #5939 from rsyslog/codex/restructure-rsyslog-docs-for-module-name
doc: split imudp parameter docs
2025-08-14 14:03:44 +02:00
Rainer Gerhards
d5c2f2cea1
doc: split imudp parameter docs 2025-08-14 13:58:29 +02:00
Rainer Gerhards
cc37c728b2
Merge pull request #5935 from rgerhards/ommysql-nitfix
ommysql: remove long-standing non-needed TODO item
2025-08-14 11:44:52 +02:00
Rainer Gerhards
9405380eb4
Merge pull request #5936 from rgerhards/ci-sphinx-quite
CI: suppress unneded sphinx output during CI builds
2025-08-14 09:35:59 +02:00
Rainer Gerhards
081df56c2c
CI: suppress unneded sphinx output during CI builds
We are interested in errors and warnings. The rest, like progress
indicator, just distracts.
2025-08-14 09:29:49 +02:00
Rainer Gerhards
3bd81ac6d6
ommysql: remove long-standing non-needed TODO item
This item was create in 2007 and has proven in ~20yrs of practice
to be no issue. Even more so, this is now in legacy code that will
no longer be updated at all. So the TODO no longer applies and could
be removed.
2025-08-14 09:22:14 +02:00
Rainer Gerhards
d4ea86aaae doc: increase visibility of reverse DNS cache controls 2025-08-13 19:19:27 +02:00
Rainer Gerhards
2128c9be62 doc: clarify reverse DNS cache scope
Explain that TTL settings only affect reverse lookups for inbound messages. Forward lookups for outbound connections rely on the system resolver and are not cached. Remove ChangeLog entry per project policy.

AI-Agent: ChatGPT
2025-08-13 18:27:17 +02:00
Rainer Gerhards
d9e53bc70a
Merge pull request #5931 from rsyslog/codex/restructure-rsyslog-docs-for-module-omkafka
docs: split omkafka action parameters into pages
2025-08-13 17:09:28 +02:00
Rainer Gerhards
8b65504159 chore: document AI-generated changes
AI-Agent: ChatGPT
2025-08-13 17:03:29 +02:00
Rainer Gerhards
a5a2205b9a
Merge pull request #5927 from rgerhards/ommysql-upd
AI support: update meta info on ommysql after patches
2025-08-13 13:55:10 +02:00
Rainer Gerhards
4aefb9ad2a
AI support: update meta info on ommysql after patches 2025-08-13 13:52:43 +02:00
Rainer Gerhards
3f34b8ec77
Merge pull request #5925 from rsyslog/ommysql-remove-rwlock
ommysql: remove unneeded rwlock
2025-08-13 13:42:39 +02:00
google-labs-jules[bot]
737440ed46
ommysql: drop global rwlock_hmysql, revert a3b2983
Removed the global pthread_rwlock_t rwlock_hmysql and related locking
around worker-local MYSQL *hmysql handles. Each worker owns its handle
exclusively, so no cross-thread access occurs and the global lock adds
unnecessary overhead.

Commit a3b2983 (2021) introduced this lock without clearly stating the
underlying issue. A thorough architectural review and targeted analysis
found no flaw in rsyslog’s code or in the mariadb/mysql client libraries.
Web research also showed no known relevant defects. The most plausible
explanation is that the original change addressed a CI-induced race,
which would be consistent with other CI flake fixes we have made in
recent years.

Given the absence of a reproducible problem and the fact that the
locking code itself introduced theoretical races (never observed in
practice), we are reverting a3b2983’s behavior. We will monitor for
any regressions.

closes https://github.com/rsyslog/rsyslog/issues/5890
2025-08-13 12:50:40 +02:00
Rainer Gerhards
807db0478b
maintain ChangeLog 2025-08-13 11:39:33 +02:00