Hey team, we currently have GrowthBook set up in o...
# give-feedback
a
Hey team, we currently have GrowthBook set up in one of our services. In order to run an experiment we are calling the following method:
Copy code
def evaluateFeature(
    feature: String,
    experimentAttributes: String,
  ): FeatureResult[String] = {
    GrowthBook.setAttributes(experimentAttributes)
    GrowthBook.evalFeature(feature, classOf[String])
  }
The issue is that at any given time N concurrent calls of that can be made. Each call tries to set the attributes but the problem arises when client X sets attributes, then client Y sets attributes, and immediately after that client X calls
GrowthBook.evalFeature
and the attributes being used are from client Y and not client X. The issue is that this is including some of our subjects in experiments when it shouldn’t be because they would not actually fit the targeting conditions. One way to fix this is to instantiate a GrowthBook instance per client so that it has its own context, but I know that is not recommended. Do you guys have any good solution for this type of problem? cc: @rhythmic-agency-4145
@fresh-football-47124 sorry for the direct ping but we’re trying to get an AB experiment up soon and this caused issues
f
We faced the same issue in our service, the only fix that i was able to find is to create a new Growthbook instance for every new incoming request. for reference, I am using java sdk
🙏 1