Skip to content

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

@george-mcintyre

Description

@george-mcintyre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions