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

Support for buffering messages until network comes up #20

Open
troglobit opened this issue May 12, 2020 · 1 comment
Open

Support for buffering messages until network comes up #20

troglobit opened this issue May 12, 2020 · 1 comment
Milestone

Comments

@troglobit
Copy link
Owner

When a remote target is configured and networking is not yet up we drop messages and retry with the next message. For some use-cases this is not good enough.

NetBSD syslogd has implemented struct buf_msg which is used for queuing messages for certain log targets. They do not support UDP remote hosts (F_FORW) with this mechanism, only F_FILE, F_TTY, F_FIFO, F_PIPE, and possibly (the new secure TLS over TCP mech) F_TLS, but the concept should work also for UDP. Look for F_FORW, UdpSend() and cases EHOSTDOWN, EHOSTUNREACH, and ENETDOWN.

http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.sbin/syslogd/syslogd.c?rev=1.131&content-type=text/x-cvsweb-markup


Grafting the struct buf_msg construct onto sysklogd would entail a lot of work since it means refactoring the internals and irrevocably going down the NetBSD track with the sysklogd project. This is not necessarily a bad thing, would only make it harder to port features from FreeBSD. However, the NetBSD implementation is the current state of the art and includes support for, e.g., TLS which we want to add anyway.

The most important constraint, however, is adding a high watermark for memory use to message_queue_add(), to prevent this buffering mechanism from eating up all available memory on embedded targets. This watermark should be configurable by the user, similar to the log rotation feature. The queuing should probably also be implemented as ring buffer, so that when we reach the high water mark for buffered messages, we drop the first one(s) to make room for new messages.

@troglobit troglobit added this to the v2.2.0 milestone May 14, 2020
@troglobit
Copy link
Owner Author

Postponing for v2.3.0

@troglobit troglobit modified the milestones: v2.2.0, v2.3.0 Aug 31, 2020
@troglobit troglobit modified the milestones: v2.3.0, FUTURE Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant