René's URL Explorer Experiment


Title: On a multi-thread context, the use of this method could lead to "HTTPSConnectionPool ... Max retries exceeded with url..." · Issue #35 · clearbit/clearbit-python · GitHub

Open Graph Title: On a multi-thread context, the use of this method could lead to "HTTPSConnectionPool ... Max retries exceeded with url..." · Issue #35 · clearbit/clearbit-python

X Title: On a multi-thread context, the use of this method could lead to "HTTPSConnectionPool ... Max retries exceeded with url..." · Issue #35 · clearbit/clearbit-python

Description: clearbit-python/clearbit/resource.py Line 46 in 5594e82 response = requests.get(endpoint, **options) The use of "requests" component library on a multi-thread context with a large number of concurrent threads requests data to Clearbit Se...

Open Graph Description: clearbit-python/clearbit/resource.py Line 46 in 5594e82 response = requests.get(endpoint, **options) The use of "requests" component library on a multi-thread context with a large number of concurr...

X Description: clearbit-python/clearbit/resource.py Line 46 in 5594e82 response = requests.get(endpoint, **options) The use of "requests" component library on a multi-thread context with a large number ...

Opengraph URL: https://github.com/clearbit/clearbit-python/issues/35

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On a multi-thread context, the use of this method could lead to \"HTTPSConnectionPool ... Max retries exceeded with url...\"","articleBody":"https://github.com/clearbit/clearbit-python/blob/5594e824663b8aaa615e1ec15af61d309239716a/clearbit/resource.py#L46\r\n\r\nThe use of \"requests\" component library on a multi-thread context with a large number of concurrent threads requests data to Clearbit Servers, as an example, using the Reveal API to find company data by IP. We could got an error from server. But, this is not an issue on server side, because server has a limit and this is fine. The problem is how to handle this issue on client side.\r\n\r\nSo, I made an improve on my own using the code below:\r\n\r\n_A little brief on this code: Find company by IP._\r\n\r\nTo highlight the improvement, the code add a Retry strategy to handle issues when the server returns the status code [429, 500, 502, 503, 504. Just remembering that this is from my case, we should refactor this using a factory + configuration design model to avoid hardocoded configuration on this end.\r\n\r\n```python\r\n\r\n@staticmethod\r\ndef __createSession__():\r\n    session = requests.Session()\r\n    retry = Retry(\r\n        total=3,\r\n        backoff_factor=1,\r\n        status_forcelist=[429, 500, 502, 503, 504],\r\n        method_whitelist=[\"HEAD\", \"GET\", \"OPTIONS\"]\r\n    )\r\n    adapter = HTTPAdapter(max_retries=retry)\r\n    session.mount('http://', adapter)\r\n    session.mount('https://', adapter)\r\n    return session\r\n\r\n\r\n def findCompanyInfoByIp(self, ip: string) -\u003e ClearbitResult:\r\n        if ip is None or ip == \"\":\r\n            return ErrorClearbitResult(f\"Can't find clearbit data with a valid ip\")\r\n        url = f\"{BASE_URL}/find?ip={urllib.parse.quote(ip)}\"\r\n        try:\r\n            response = \\\r\n                self.__requestSession.get(\r\n                    url,\r\n                    auth=BearerAuth(self.__authToken))\r\n            return ClearbitResult(response)\r\n        except Exception as e:\r\n            errorMessage = f\"Error requesting Clearbit at [{url}]: {e}\"\r\n            self.__logger.error(errorMessage)\r\n            return ErrorClearbitResult(errorMessage)\r\n```\r\n\r\nThis solution helps me to ensure 100 or maybe more threands to requests Clearbit Reveal API using a simple retry strategy.\r\n\r\nCould this be an improvement to help this library?","author":{"url":"https://github.com/fabiofalavinha","@type":"Person","name":"fabiofalavinha"},"datePublished":"2021-09-13T12:51:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/35/clearbit-python/issues/35"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b0bfc2fd-fa78-441f-b39c-c3accc52c6e8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC5C4:3C057:27EA4E:36BDE9:6981F234
html-safe-nonce68f72d1492ab28b886cdca398c468457b51159b0cb0f129192332fe71a540c36
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUM0OjNDMDU3OjI3RUE0RTozNkJERTk6Njk4MUYyMzQiLCJ2aXNpdG9yX2lkIjoiMzU3OTcwNDg0MTgyMTM1MjUwMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca2844ee3055ef9c9c945ffabdc84ab1b743d37d30a6b1fee3563bed56a352809
hovercard-subject-tagissue:994852686
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/clearbit/clearbit-python/35/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6a97d89c6fd014c926aa0b567f7174f693a8da9129be56558128ebfb8a93d77a/clearbit/clearbit-python/issues/35
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6a97d89c6fd014c926aa0b567f7174f693a8da9129be56558128ebfb8a93d77a/clearbit/clearbit-python/issues/35
og:image:altclearbit-python/clearbit/resource.py Line 46 in 5594e82 response = requests.get(endpoint, **options) The use of "requests" component library on a multi-thread context with a large number of concurr...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefabiofalavinha
hostnamegithub.com
expected-hostnamegithub.com
Noneebfdf8d3e0fd17b103f41cc6696d84938694ebebdfecaf11fe00dbe4a9785801
turbo-cache-controlno-preview
go-importgithub.com/clearbit/clearbit-python git https://github.com/clearbit/clearbit-python.git
octolytics-dimension-user_id9300813
octolytics-dimension-user_loginclearbit
octolytics-dimension-repository_id27684447
octolytics-dimension-repository_nwoclearbit/clearbit-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27684447
octolytics-dimension-repository_network_root_nwoclearbit/clearbit-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseac4541b58a15c144d6ed4fc868b9ea4bb99bb4b6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues/35#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclearbit%2Fclearbit-python%2Fissues%2F35
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclearbit%2Fclearbit-python%2Fissues%2F35
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=clearbit%2Fclearbit-python
Reloadhttps://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues/35
Reloadhttps://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues/35
Reloadhttps://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues/35
clearbit https://patch-diff.githubusercontent.com/clearbit
clearbit-pythonhttps://patch-diff.githubusercontent.com/clearbit/clearbit-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fclearbit%2Fclearbit-python
Fork 33 https://patch-diff.githubusercontent.com/login?return_to=%2Fclearbit%2Fclearbit-python
Star 36 https://patch-diff.githubusercontent.com/login?return_to=%2Fclearbit%2Fclearbit-python
Code https://patch-diff.githubusercontent.com/clearbit/clearbit-python
Issues 9 https://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues
Pull requests 3 https://patch-diff.githubusercontent.com/clearbit/clearbit-python/pulls
Actions https://patch-diff.githubusercontent.com/clearbit/clearbit-python/actions
Projects 0 https://patch-diff.githubusercontent.com/clearbit/clearbit-python/projects
Wiki https://patch-diff.githubusercontent.com/clearbit/clearbit-python/wiki
Security 0 https://patch-diff.githubusercontent.com/clearbit/clearbit-python/security
Insights https://patch-diff.githubusercontent.com/clearbit/clearbit-python/pulse
Code https://patch-diff.githubusercontent.com/clearbit/clearbit-python
Issues https://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues
Pull requests https://patch-diff.githubusercontent.com/clearbit/clearbit-python/pulls
Actions https://patch-diff.githubusercontent.com/clearbit/clearbit-python/actions
Projects https://patch-diff.githubusercontent.com/clearbit/clearbit-python/projects
Wiki https://patch-diff.githubusercontent.com/clearbit/clearbit-python/wiki
Security https://patch-diff.githubusercontent.com/clearbit/clearbit-python/security
Insights https://patch-diff.githubusercontent.com/clearbit/clearbit-python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/clearbit/clearbit-python/issues/35
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/clearbit/clearbit-python/issues/35
On a multi-thread context, the use of this method could lead to "HTTPSConnectionPool ... Max retries exceeded with url..."https://patch-diff.githubusercontent.com/clearbit/clearbit-python/issues/35#top
https://github.com/fabiofalavinha
https://github.com/fabiofalavinha
fabiofalavinhahttps://github.com/fabiofalavinha
on Sep 13, 2021https://github.com/clearbit/clearbit-python/issues/35#issue-994852686
clearbit-python/clearbit/resource.pyhttps://github.com/clearbit/clearbit-python/blob/5594e824663b8aaa615e1ec15af61d309239716a/clearbit/resource.py#L46
5594e82https://patch-diff.githubusercontent.com/clearbit/clearbit-python/commit/5594e824663b8aaa615e1ec15af61d309239716a
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.