Skip to content

DSSClient spontaneaously reverts to prod, even when configured with different host #142

@hannes-ucsc

Description

@hannes-ucsc

The prescribed method to switch the DSSClient to a different host is

client = hca.dss.DSSClient()
client.host = "https://dss.example.com/v1"

There are two problems with this approach:

For one the swagger def is downloaded (or loaded from disk) in the constructor, defaulting to the HCA prod instance. There is no guarantee that the dss.example.com endpoint has a compatible API.

More puzzling is that the client seems to sporadically revert to using the prod instance, even when configured to a different host as outlined above. This must be a race condition. I do have multiple threads sharing a client.

If I instantiate the client in the following way, the problem goes away (the client does not revert to prod):

 config = HCAConfig("hca")
 config['DSSClient'].swagger_url = 'https://dss.example.com/v1/swagger.json'
 self.dss_client = DSSClient(config=config)

This is all I got, I don't have time to dig deeper right now.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions