Skip to content

Conversation

bazsi
Copy link
Collaborator

@bazsi bazsi commented Dec 2, 2017

An alternative for #1787

bazsi added 3 commits December 1, 2017 17:01
…uld be using a local variable

This patch gets rid off the reuse of KVScanner instances accross different
messages in production.  KVScanners have never been threadsafe, and thus a
cloning of it was introduced for every message received.

This patch gets rid off the clone and rather takes the performance hit of
having to allocate a couple of GString instances, and making the KVScanner
instance a local variable in the process function.

Signed-off-by: Balazs Scheidler <[email protected]>
…t loop

As the production code does that same, so these numbers are more realistic.

Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi
Copy link
Collaborator Author

bazsi commented Dec 2, 2017

Removes a lot of boilerplate, increases performance, and resolves a race. :)

@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

Signed-off-by: Balazs Scheidler <[email protected]>
Signed-off-by: László Várady <[email protected]>
@MrAnno MrAnno force-pushed the kv-scanner-scratch-buffers branch from ec85630 to 43007c5 Compare December 3, 2017 02:30
@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

@mitzkia
Copy link
Contributor

mitzkia commented Dec 3, 2017

Tested with the reproduction in #1773, syslog-ng did not crash.

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

Successfully merging this pull request may close these issues.

5 participants