[Bro-Dev] [JIRA] (BIT-1547) broctl sets the same state variables over and over

Robin Sommer (JIRA) jira at bro-tracker.atlassian.net
Tue Mar 8 07:18:03 PST 2016


     [ https://bro-tracker.atlassian.net/browse/BIT-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robin Sommer reassigned BIT-1547:
---------------------------------

    Assignee: Justin Azoff

> broctl sets the same state variables over and over
> --------------------------------------------------
>
>                 Key: BIT-1547
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1547
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: BroControl
>    Affects Versions: git/master
>            Reporter: Justin Azoff
>            Assignee: Justin Azoff
>             Fix For: 2.5
>
>
> I happened to notice broctl check on one of our test boxes was slow.  traced it to sqlite commits() being very slow.  Then noticed that broctl seems to call set_state() with the same key, val over and over again... once for each worker.. so a few thousand sets just to run broctl check.
> Changing set_state to
> {code}
>     # Set a dynamic state variable.
>     def set_state(self, key, val):
>         key = key.lower()
>         if self.state.get(key) == val:
>             return
>         self.state[key] = val
>         self.state_store.set(key, val)
> {code}
> Seemed to mostly fix it, aside from this:
> {code}
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> {code}
> any idea why that is flipping around like that?
> We should possibly add a way for broctl to update state vars without calling commit where it knows it will be setting a large number of state vars in a loop.



--
This message was sent by Atlassian JIRA
(v7.2.0-OD-03-012#72000)


More information about the bro-dev mailing list