Change in libosmocore[master]: logging: Change stderr + file target to use non-blocking write

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Sun Sep 27 11:52:23 UTC 2020


pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/20296 )

Change subject: logging: Change stderr + file target to use non-blocking write
......................................................................


Patch Set 4:

(4 comments)

https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c 
File src/logging.c:

https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c@856 
PS4, Line 856: 	unsigned int len = strlen(log);
Would be great checking if strlen() is already done in caller of output() function, to see if we can avoid recalculating it here by passing it as a parameter.


https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c@869 
PS4, Line 869: 	osmo_wqueue_enqueue_quiet(target->tgt_file.wqueue, msg);
here it fails if wqueue is too full right? What about manually introducing a last msgb with content "QUEUE WAS FULL", that should be helpful.


https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c@926 
PS4, Line 926: 	if (rc != msgb_length(msg))
Here, upon short write (possible if we are in NONBLOCK afaiu) instead of returning error and losing logging data, we should recreate a new msgb and prepend it to the queue so it's printed next time writing is available.


https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/select.c 
File src/select.c:

https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/select.c@283 
PS4, Line 283: 	log_target_file_switch_to_wqueue(osmo_stderr_target);
Fine with doing this by default, but it may make sense to have a VTY command to set a flag to avoid doing this here, or calling it explicitly if it's explicitly enabled in VTY.
This way you can control this regardless of use of osmo_select_main while still allowing for default sane options.



-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20296
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia58fd78535c41b3da3aeb7733aadc785ace610da
Gerrit-Change-Number: 20296
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Sun, 27 Sep 2020 11:52:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200927/d862a6f8/attachment.htm>


More information about the gerrit-log mailing list