Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't do a ClientFactory.start(), ClientFactory.stop(), then ClientFactory.start() in same session #119

Open
george-mcintyre opened this issue Dec 20, 2021 · 0 comments

Comments

@george-mcintyre
Copy link

Code Reference

  • ClientFactory.java:88 : ClientFactory.start()
  • ClientFactory.java:97: ClientFactory.stop()

To reproduce

When the following pattern is used:

ClientFactory.start();
// ... execute pvAccess request
ClientFactory.stop();

the static factory property in ClientFactory is set to a new ChannelProviderFactoryImpl() in ClientFactory.start() but is not cleared in ClientFactory.stop() if factory.destroySharedInstance() fails, even though the factory itself is unregistered. This means that the guard condition in ClientFactory.start() will prevent re-registering of the ChannelProviderFactory and thus all subsequent pvAccess requests fail. In slow network conditions I find that factory.destroySharedInstance() fails more often than not.

Problem:

When implementing a pvAccess executor for a scripted language in a slow network environment this pattern does not work because only the first pvAccess request works. I have to omit the ClientFactory.stop() to make subsequent pvAccess requests work.

Suggestion/Possible fix:

Set static ClientFactory.factory to null whether the factory.destroySharedInstance() succeeds or not. ClientFactory.java:103

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

No branches or pull requests

1 participant