[gelf] Replace '/' with '_' in keys when converting from msgpack.#1166
[gelf] Replace '/' with '_' in keys when converting from msgpack.#1166edsiper merged 1 commit intofluent:masterfrom
Conversation
|
Looks like it does as described. Seems like there are potential leaks in the early-outs (out of memory situation). |
|
Hey @nigels-com , thanks for your review and suggestion! I was aware of the memory leaks, but I didn't have any obvious fix for it, other than just freeing the copies in every branch, which would get quite verbose (on the other hand, I agree that's not really a reason to ignore memory leaks 🙂 ). I'll look for a P.S.: I have used this patch in production for a week now, without any issues (the leak didn't trigger, as there were no further encoding errors). |
|
In C++ this tends to be less of an issue, of course. The sort of pattern I suggest is something like: It's one of the few remaining legitimate uses of |
|
Done. I also safe-guarded the if (copy) {
flb_free(copy);
}, just in case. |
|
For the sake of portability, I'd recommend the NULL check. I do see NULL checks elsewhere in the codebase: |
|
@nigels-com I'm not sure I get what you mean, didn't I do exactly that? |
|
Hey @knackaron , sorry for the radio silence, I've been busy with work. I'll try to work on this next week, but feel free to take over, if you want. |
ab2d7a2 to
201beec
Compare
Allows logs from Kubernetes pods to have labels or annotations containing '/' by replacing it with '_', as '/' is not a valid GELF field name character. Signed-off-by: Bogdan Luca <luca.bogdan@gmail.com>
|
Squashed the commits, updated the commit subject, should be ready for merge. |
|
@lbogdan No worries. Thanks for kicking out an updated patch over the weekend. |
|
Is there anything blocking the pull request? The requested change by @edsiper seems to be incorporated in the new commit. |
|
@edsiper can you confirm that your requested change is now included? |
|
There's also #1365 , which is replacing more than just |
|
thanks everyone! |
Allows logs form Kubernetes pods having labels or annotations containing '/' in the name, which is not a valid GELF field name.
Also changes the log level to
errorand adds the invalid char position to "invalid key char" errors.Fixes #1070 , #1291 .