Thread safety issue under load

Description

When placing a throughput load of approximately 15 queries per second we can intermittently see a 'java.lang.IndexOutOfBoundsException'.

Upon further investigation it was found that the BoboSearcher2 class is using an instance variable '_facetCollectors' which is not thread safe. This variable is set by a call from the BoboSubBrowser.browse method which could be executed via multiple threads simultaneously.

Changing this instance variable to utilise a ThreadLocal instead addresses this problem.

Please find a patch file attached.

Environment

OS X and Ubuntu

Assignee

Yasuhiro Matsuda

Reporter

James Stevenson

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure