{"action":"opened","issue":{"url":"https://api.github.com/repos/HumanCellAtlas/dcp-cli/issues/142","repository_url":"https://api.github.com/repos/HumanCellAtlas/dcp-cli","labels_url":"https://api.github.com/repos/HumanCellAtlas/dcp-cli/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/HumanCellAtlas/dcp-cli/issues/142/comments","events_url":"https://api.github.com/repos/HumanCellAtlas/dcp-cli/issues/142/events","html_url":"https://github.com/HumanCellAtlas/dcp-cli/issues/142","id":345099338,"node_id":"MDU6SXNzdWUzNDUwOTkzMzg=","number":142,"title":"DSSClient spontaneaously reverts to prod, even when configured with different host","user":{"login":"hannes-ucsc","id":5143256,"node_id":"MDQ6VXNlcjUxNDMyNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/5143256?v=4","gravatar_id":"","url":"https://api.github.com/users/hannes-ucsc","html_url":"https://github.com/hannes-ucsc","followers_url":"https://api.github.com/users/hannes-ucsc/followers","following_url":"https://api.github.com/users/hannes-ucsc/following{/other_user}","gists_url":"https://api.github.com/users/hannes-ucsc/gists{/gist_id}","starred_url":"https://api.github.com/users/hannes-ucsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannes-ucsc/subscriptions","organizations_url":"https://api.github.com/users/hannes-ucsc/orgs","repos_url":"https://api.github.com/users/hannes-ucsc/repos","events_url":"https://api.github.com/users/hannes-ucsc/events{/privacy}","received_events_url":"https://api.github.com/users/hannes-ucsc/received_events","type":"User","site_admin":false},"labels":[{"id":621165268,"node_id":"MDU6TGFiZWw2MjExNjUyNjg=","url":"https://api.github.com/repos/HumanCellAtlas/dcp-cli/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-27T05:53:14Z","updated_at":"2018-07-27T05:53:14Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The [prescribed](https://github.com/HumanCellAtlas/dcp-cli/blame/17e1b202f81e4fa1a0306e417ca528bbd7d150c4/README.rst#L54) method to switch the DSSClient to a different host is \r\n\r\n```\r\nclient = hca.dss.DSSClient()\r\nclient.host = \"https://dss.example.com/v1\"\r\n```\r\n\r\nThere are two problems with this approach:\r\n\r\nFor 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.\r\n\r\nMore 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.\r\n\r\nIf I instantiate the client in the following way, the problem goes away (the client does not revert to prod):\r\n\r\n```\r\n config = HCAConfig(\"hca\")\r\n config['DSSClient'].swagger_url = 'https://dss.example.com/v1/swagger.json'\r\n self.dss_client = DSSClient(config=config)\r\n```\r\n\r\nThis is all I got, I don't have time to dig deeper right now.\r\n"}}
{"actor":{"display_login":"hannes-ucsc"}}