Title: HTTPClient not thread safe · Issue #144 · python-consul/python-consul · GitHub
Open Graph Title: HTTPClient not thread safe · Issue #144 · python-consul/python-consul
X Title: HTTPClient not thread safe · Issue #144 · python-consul/python-consul
Description: I want to use consul python module in a multiprocessing context : I need to execute x process and each of them is fetching node from consul with are advertising a special service, with special tag To give you an idea, the code is almost ...
Open Graph Description: I want to use consul python module in a multiprocessing context : I need to execute x process and each of them is fetching node from consul with are advertising a special service, with special tag ...
X Description: I want to use consul python module in a multiprocessing context : I need to execute x process and each of them is fetching node from consul with are advertising a special service, with special tag ...
Opengraph URL: https://github.com/python-consul/python-consul/issues/144
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"HTTPClient not thread safe","articleBody":"I want to use consul python module in a multiprocessing context : I need to execute x process and each of them is fetching node from consul with are advertising a special service, with special tag\r\nTo give you an idea, the code is almost this\r\n```py \r\ndef run:\r\n job = []\r\n for item in list_a:\r\n job = multiprocessing.Process(name='Process' + item, target=process,\r\n args=(item))\r\n job.daemon = False\r\n jobs.append(job)\r\n job.start()\r\n for job in jobs:\r\n job.join()\r\n\r\n\r\ndef process(item):\r\n consul_api.health.service(MY_SERVICE, tag=item, dc=datacenter)\r\n```\r\nI was printing in base.py the result of the request and there was wrong results, I add this to service method of class Health \r\n```py\r\nprint \"------------------%s %s %s\" % (service,tag,self.agent.http.get(\r\n CB.json(index=True),\r\n '/v1/health/service/%s' % service,\r\n params=params))\r\n```\r\nthe was mixed results\r\nlet say for tag1, it returns result for tag2","author":{"url":"https://github.com/jkhelil","@type":"Person","name":"jkhelil"},"datePublished":"2017-03-20T17:05:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/144/python-consul/issues/144"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:115ce8af-6f44-7e55-2308-d64f3c93b823 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E574:12A68A:276202A:33BA51A:6976FA34 |
| html-safe-nonce | bf821d49bb2a34cb976ecb548f2c583be48dfd58c5b8d5dfab04f9ac0a95b9ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTc0OjEyQTY4QToyNzYyMDJBOjMzQkE1MUE6Njk3NkZBMzQiLCJ2aXNpdG9yX2lkIjoiODA3MDIxNjU3NDI2MzgxODgwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4b3bbfb8232c08b788f8615b4a18d7778860165a794d72b6c8bdbb0d96e01ddb |
| hovercard-subject-tag | issue:215489041 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-consul/python-consul/144/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c54dbdca4e9d73ea83477f54928a356f39bbb39693b755bb3921bff2c42e5070/python-consul/python-consul/issues/144 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c54dbdca4e9d73ea83477f54928a356f39bbb39693b755bb3921bff2c42e5070/python-consul/python-consul/issues/144 |
| og:image:alt | I want to use consul python module in a multiprocessing context : I need to execute x process and each of them is fetching node from consul with are advertising a special service, with special tag ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jkhelil |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-consul/python-consul git https://github.com/python-consul/python-consul.git |
| octolytics-dimension-user_id | 143416393 |
| octolytics-dimension-user_login | python-consul |
| octolytics-dimension-repository_id | 24473148 |
| octolytics-dimension-repository_nwo | python-consul/python-consul |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24473148 |
| octolytics-dimension-repository_network_root_nwo | python-consul/python-consul |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width