You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When ClientContext is use as a request scope bean in Spring Boot, a new JerseyClient is created at each request.
Spring Boot close/destroy/shudown every request scope beans at the end of the requests. This cause the new JerseyClient to be closed and the request to be stuck sometimes a several seconds on edgeService.close() / eventInput.close().
Explanation ;
In FeatureHubConfig:newContext, edgeService is a Supplier<EdgeService> and not a EdgeService.
By default, the implemention of this supplier is :
public class JerseyFeatureHubClientFactory implements FeatureHubClientFactory {
@Override
public Supplier<EdgeService> createEdgeService(FeatureHubConfig config, FeatureStore repository) {
return () -> new JerseyClient(config, repository);
}
}
Because of this, when the ClientEvalFeatureContext is built inside FeatureHubConfig:newContext, edgeService.get() will provide the constructor with new JerseyClient(config, repository).
Which area does this issue belong to?
FeatureHub Admin Web app
SDK
SDK examples
Documentation
Other
To Reproduce
With the Spring Boot exemple, make a request.
Expected behavior
Each new ClientEvalFeatureContext should use the repository and the edge service built inside FeatureHubConfig:init, and not be provided with a new one.
Carefull, if this is fixed, the edge service must not be closed in ClientEvalFeatureContext:close
Versions
SDK version [e.g. 2.4]
The text was updated successfully, but these errors were encountered:
rvowles
transferred this issue from featurehub-io/featurehub
Jul 8, 2022
Describe the bug
Discussion featurehub-io/featurehub#805
When
ClientContext
is use as a request scope bean in Spring Boot, a new JerseyClient is created at each request.Spring Boot close/destroy/shudown every request scope beans at the end of the requests. This cause the new JerseyClient to be closed and the request to be stuck sometimes a several seconds on
edgeService.close()
/eventInput.close()
.Explanation ;
In
FeatureHubConfig:newContext
,edgeService
is aSupplier<EdgeService>
and not aEdgeService
.By default, the implemention of this supplier is :
Because of this, when the
ClientEvalFeatureContext
is built insideFeatureHubConfig:newContext
,edgeService.get()
will provide the constructor withnew JerseyClient(config, repository)
.Which area does this issue belong to?
To Reproduce
With the Spring Boot exemple, make a request.
Expected behavior
Each new
ClientEvalFeatureContext
should use the repository and the edge service built insideFeatureHubConfig:init
, and not be provided with a new one.Carefull, if this is fixed, the edge service must not be closed in
ClientEvalFeatureContext:close
Versions
The text was updated successfully, but these errors were encountered: