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

ldpd, lib: integrate lde/ldpe into standard logging infrastructure #15515

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

eqvinox
Copy link
Contributor

@eqvinox eqvinox commented Mar 10, 2024

The lde/ldpe subprocesses previously used ldp-only IMSG_LOG messages between lde/ldpe and the main ldpd process, which then threw the messages into zlog_*. This has the unfortunate side effect of losing the unique ID information, but also that assert()s don't get consistent backtraces, and debug messages are not batched for efficiency.

⇒ rework by using the zlog_live log target that is already used for daemon⇒vtysh log messages by adding a receiver in ldpd so we can do daemon⇒daemon

ldpd/log.c is now no longer necessary & entirely removed. UIDs work, asserts get backtraces, and debug messages are batched.


Note ldpd uses its original BSD coding style, any style warnings in ldpd/* are bogus.

eqvinox added 2 commits March 10, 2024 12:42
This is primarily intended for ldpd with its split-process architecture.
The LDE/LDPE subprocesses currently lose the extended zlog
functionality.

The zlog_live target already encapsulates all necessary bits for vtysh.
Reuse it for a relay function to be used in the main ldpd process.

Signed-off-by: David Lamparter <[email protected]>
This way, full functionality of `zlog_*` is available.

Having `fatal()` be wrappers around `assertf()` also means we get
backtraces, which is not the case for a plain `exit(1)`.

Signed-off-by: David Lamparter <[email protected]>
@eqvinox eqvinox force-pushed the zlog-recirculate-ldpd branch from 4789d82 to 95a737e Compare March 10, 2024 11:45
@donaldsharp
Copy link
Member

Once CI finishes I will push in.

@donaldsharp donaldsharp merged commit 5c30b2e into FRRouting:master Mar 10, 2024
9 checks passed
@eqvinox eqvinox deleted the zlog-recirculate-ldpd branch March 11, 2024 14:35
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