René's URL Explorer Experiment


Title: Error when two requests are too close in time · spotify-web-api-java/spotify-web-api-java · Discussion #367 · GitHub

Open Graph Title: Error when two requests are too close in time · spotify-web-api-java/spotify-web-api-java · Discussion #367

X Title: Error when two requests are too close in time · spotify-web-api-java/spotify-web-api-java · Discussion #367

Description: Error when two requests are too close in time

Open Graph Description: Hi, I'm getting this error when I make a request close after another (not always, it's a range, not inmediate and not long after it): java.lang.IllegalStateException: Connection 192.168.1.152:43204...

X Description: Hi, I'm getting this error when I make a request close after another (not always, it's a range, not inmediate and not long after it): java.lang.IllegalStateException: Connection 192.168.1.1...

Opengraph URL: https://github.com/spotify-web-api-java/spotify-web-api-java/discussions/367

X: @github

direct link

Domain: redirect.github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Error when two requests are too close in time","text":"\u003cp dir=\"auto\"\u003eHi, I'm getting this error when I make a request close after another (not always, it's a range, not inmediate and not long after it):\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"java.lang.IllegalStateException: Connection 192.168.1.152:43204\u0026lt;-\u0026gt;35.186.224.25:443 is still allocated\n    at org.apache.hc.core5.util.Asserts.check(Asserts.java:50) ~[httpcore5-5.2.2.jar:5.2.2]\n    at org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.getConnection(BasicHttpClientConnectionManager.java:306) ~[httpclient5-5.2.1.jar:5.2.1]\n...\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode class=\"notranslate\"\u003ejava.lang.IllegalStateException: Connection 192.168.1.152:43204\u0026lt;-\u0026gt;35.186.224.25:443 is still allocated\n    at org.apache.hc.core5.util.Asserts.check(Asserts.java:50) ~[httpcore5-5.2.2.jar:5.2.2]\n    at org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager.getConnection(BasicHttpClientConnectionManager.java:306) ~[httpclient5-5.2.1.jar:5.2.1]\n...\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFrom what I read this happens when using the BasicHttpClientConnectionManager and having more than one request open, depending on timing it will reuse the connection on create a new one.\u003cbr\u003e\nI'm making the calls using the synchronous execute, but using spring boot so executions are probably in different threads (I also tried with async calls and got the same issue).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIs there a way to avoid this (I may be using the API wrong)? Right now I have a wrokaround with a wrapper that catches the exception and retries, but asking in case there's a better way to handle this.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThanks\u003c/p\u003e","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"\u003cp dir=\"auto\"\u003eYou're on the right track. You can try to \u003ca href=\"https://stackoverflow.com/a/14866394/4682621\" rel=\"nofollow\"\u003euse a pooling connection manager\u003c/a\u003e as \u003ccode class=\"notranslate\"\u003ehttpManager\u003c/code\u003e by \u003ca href=\"https://spotify-web-api-java.github.io/spotify-web-api-java/se/michaelthelin/spotify/SpotifyApi.Builder.html\" rel=\"nofollow\"\u003ebuilding a custom SpotifyApi instance\u003c/a\u003e.\u003c/p\u003e","upvoteCount":1,"url":"https://github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7560730"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:a8e48309-02b2-a79f-b8c1-4a73e2491e09
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id8A8A:8C6A0:A79BD5:F0895C:6A6219DA
html-safe-nonce64126eabee15811212403fa6fbeec5b0fb8cceec4c26dcf1e89bffa9f3d07a9f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QThBOjhDNkEwOkE3OUJENTpGMDg5NUM6NkE2MjE5REEiLCJ2aXNpdG9yX2lkIjoiMzk1NTAzMjM1Mjk3NzE5NzUzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace80ce4f7940e482a2c5abe4a557cc214ce810c065be1050a0ce35a4ccbead7fa
hovercard-subject-tagdiscussion:5847938
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/spotify-web-api-java/spotify-web-api-java/367/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/9f3a0bbcc1ed594535982930842d602f10b53bceaff24a117d3d0d0c0fa84bf7/spotify-web-api-java/spotify-web-api-java/discussions/367
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9f3a0bbcc1ed594535982930842d602f10b53bceaff24a117d3d0d0c0fa84bf7/spotify-web-api-java/spotify-web-api-java/discussions/367
og:image:altHi, I'm getting this error when I make a request close after another (not always, it's a range, not inmediate and not long after it): java.lang.IllegalStateException: Connection 192.168.1.152:43204...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneccf61cb7ab435725b916ed640f57c45b2c4721db9469bc32656080efc5214b3e
turbo-cache-controlno-preview
go-importgithub.com/spotify-web-api-java/spotify-web-api-java git https://github.com/spotify-web-api-java/spotify-web-api-java.git
octolytics-dimension-user_id90800172
octolytics-dimension-user_loginspotify-web-api-java
octolytics-dimension-repository_id18928344
octolytics-dimension-repository_nwospotify-web-api-java/spotify-web-api-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id18928344
octolytics-dimension-repository_network_root_nwospotify-web-api-java/spotify-web-api-java
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
releasea7585b3d2ee639495a70ce464d0a18bad88ea12c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#start-of-content
https://redirect.github.com/
Sign in https://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspotify-web-api-java%2Fspotify-web-api-java%2Fdiscussions%2F367
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspotify-web-api-java%2Fspotify-web-api-java%2Fdiscussions%2F367
Sign up https://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=spotify-web-api-java%2Fspotify-web-api-java
Reloadhttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
Reloadhttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
Reloadhttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
spotify-web-api-java https://redirect.github.com/spotify-web-api-java
spotify-web-api-javahttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
Notifications https://redirect.github.com/login?return_to=%2Fspotify-web-api-java%2Fspotify-web-api-java
Fork 290 https://redirect.github.com/login?return_to=%2Fspotify-web-api-java%2Fspotify-web-api-java
Star 1.1k https://redirect.github.com/login?return_to=%2Fspotify-web-api-java%2Fspotify-web-api-java
Code https://redirect.github.com/spotify-web-api-java/spotify-web-api-java
Issues 2 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/issues
Pull requests 3 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/pulls
Discussions https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions
Actions https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/actions
Security and quality 0 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/security
Insights https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/pulse
Code https://redirect.github.com/spotify-web-api-java/spotify-web-api-java
Issues https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/issues
Pull requests https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/pulls
Discussions https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions
Actions https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/actions
Security and quality https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/security
Insights https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/pulse
Answered https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7560730
dargmueslihttps://redirect.github.com/dargmuesli
diego09310 https://redirect.github.com/diego09310
Q&Ahttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/categories/q-a
Error when two requests are too close in time https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#top
diego09310 https://redirect.github.com/diego09310
Answered https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7560730
dargmueslihttps://redirect.github.com/dargmuesli
Return to tophttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#top
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
diego09310 https://redirect.github.com/diego09310
Nov 13, 2023 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussion-5847938
Give feedback.https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
dargmuesli https://redirect.github.com/dargmuesli
Nov 14, 2023 https://github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7560730
use a pooling connection managerhttps://stackoverflow.com/a/14866394/4682621
building a custom SpotifyApi instancehttps://spotify-web-api-java.github.io/spotify-web-api-java/se/michaelthelin/spotify/SpotifyApi.Builder.html
View full answer https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7560730
Oldest https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367?sort=old
Newest https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367?sort=new
Top https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367?sort=top
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
dargmuesli https://redirect.github.com/dargmuesli
Nov 14, 2023 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7560730
use a pooling connection managerhttps://stackoverflow.com/a/14866394/4682621
building a custom SpotifyApi instancehttps://spotify-web-api-java.github.io/spotify-web-api-java/se/michaelthelin/spotify/SpotifyApi.Builder.html
Give feedback.https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/diego09310
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
diego09310https://redirect.github.com/diego09310
Dec 4, 2023 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7758431
Give feedback.https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/dargmuesli
Please reload this pagehttps://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
dargmueslihttps://redirect.github.com/dargmuesli
Dec 4, 2023 https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367#discussioncomment-7758676
#375https://github.com/spotify-web-api-java/spotify-web-api-java/pull/375
Give feedback.https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
diego09310https://redirect.github.com/diego09310
Sign up for freehttps://redirect.github.com/join?source=comment-repo
Sign in to commenthttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspotify-web-api-java%2Fspotify-web-api-java%2Fdiscussions%2F367
🙏 Q&A https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/categories/q-a
https://redirect.github.com/diego09310
https://redirect.github.com/dargmuesli
https://redirect.github.com/spotify-web-api-java/spotify-web-api-java/discussions/367
https://redirect.github.com/settings/replies?return_to=1
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.