René's URL Explorer Experiment


Title: Using Redis sentinel, some commands 'send' hangs · Issue #92 · cpp-redis/cpp_redis · GitHub

Open Graph Title: Using Redis sentinel, some commands 'send' hangs · Issue #92 · cpp-redis/cpp_redis

X Title: Using Redis sentinel, some commands 'send' hangs · Issue #92 · cpp-redis/cpp_redis

Description: Describe the bug When using Redis sentinel - 1 master, 2 duplicates, 3 sentinels - I can always connect to the (curent) writeable master. However, if I 'stop' that service, the next command hangs. This may not be a bug, maybe it's proper...

Open Graph Description: Describe the bug When using Redis sentinel - 1 master, 2 duplicates, 3 sentinels - I can always connect to the (curent) writeable master. However, if I 'stop' that service, the next command hangs. ...

X Description: Describe the bug When using Redis sentinel - 1 master, 2 duplicates, 3 sentinels - I can always connect to the (curent) writeable master. However, if I 'stop' that service, the next command...

Opengraph URL: https://github.com/cpp-redis/cpp_redis/issues/92

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using Redis sentinel, some commands 'send' hangs","articleBody":"**Describe the bug**\r\nWhen using Redis sentinel - 1 master, 2 duplicates, 3 sentinels - I can always connect to the (curent) writeable master.\r\n\r\nHowever, if I 'stop' that service, the next command hangs.\r\n\r\nThis may not be a bug, maybe it's proper use of Sentinel, but if this is the case the examples and/or docs should probably be updated. I can do a PR if that's the case.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Implement Redis Sentinel\r\n2. Connect to the current master\r\n3. Issue an 'lpop' command:\r\n```\r\n\tredisClient-\u003elpop(GetQueue().toStdString(), [\u0026webReply,\u0026bError](cpp_redis::reply\u0026 charRequest) {\r\n                      .... stuff ... \r\n\t\t});\r\n\tredisClient-\u003esync_commit(std::chrono::milliseconds(5000)); \r\n```\r\n\r\n4. It works fine.\r\n5. stop the current master. The slaves will fail over and promote a new master.\r\n6. The next 'lpop' command hangs down inside this routine:\r\n```\r\nclient::send(const std::vector\u003cstd::string\u003e \u0026redis_cmd, const reply_callback_t \u0026callback) {\r\n\tstd::lock_guard\u003cstd::mutex\u003e lock_callback(m_callbacks_mutex);\r\n\t__CPP_REDIS_LOG(info, \"cpp_redis::client attempts to store new command in the send buffer\");\r\n\tunprotected_send(redis_cmd, callback);\r\n\t__CPP_REDIS_LOG(info, \"cpp_redis::client stored new command in the send buffer\");\r\n\r\n```\r\n\r\n\r\n**Expected behavior**\r\nI would think issuing any serial commands to a connection that can't take it should result in a tacopie or cpp_redis error being thrown. \r\n\r\n**Possible workaround**\r\nMy routine that does the connect DOES immediately exits out:\r\n```\r\n\tLOG_INFO \u003c\u003c \"Connecting to HA Redis servers with \" \u003c\u003c iSentinels \u003c\u003c \"sentinels\";\r\n\tbool bDisconnect = false;\r\n\tredisClient-\u003econnect(\"ourcluster\", [\u0026bDisconnect](const std::string\u0026 host, std::size_t port, cpp_redis::connect_state status) {\r\n\t\tif (status == cpp_redis::connect_state::dropped) {\r\n\t\t\tLOG_INFO \u003c\u003c \"Client disconnected from \" \u003c\u003c host.c_str() \u003c\u003c \":\" \u003c\u003c port;\r\n```\r\n\r\nThe 'dropped' fires right off, so I could assign a bool value, and then in the outer loop, before every command check to see if we're disconnected - but that seems like a lot of potential boilerplate code.\r\n\r\nI guess I could also just try to reconnect inside the 'connect' callback? Is that the right way to do it? The code example didn't show this\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: [Windows 10]\r\n - Browser [n/a]\r\n - Version [Current]\r\n\r\n","author":{"url":"https://github.com/jgwinner","@type":"Person","name":"jgwinner"},"datePublished":"2022-05-02T04:43:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/92/cpp_redis/issues/92"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1308ce52-2707-96d6-8cc6-db720cc792bd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA994:3BFB17:2D46F6C:3A94748:69749EC8
html-safe-nonceae908d0c528b665a9414d21d41487d3ee200d27a9879acf583edbb241b0e2812
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTk0OjNCRkIxNzoyRDQ2RjZDOjNBOTQ3NDg6Njk3NDlFQzgiLCJ2aXNpdG9yX2lkIjoiNzI3NTI1NTM4NjYxNTM1NzEyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac772058d598baa97ef319a1d5837b3dc29ec90d9dd129ee09002597cd9d07ce5d
hovercard-subject-tagissue:1222476163
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/cpp-redis/cpp_redis/92/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c36af04fcda51e6f456baad71f80091cc40569d1d8fedd157101edd0ef4948fd/cpp-redis/cpp_redis/issues/92
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c36af04fcda51e6f456baad71f80091cc40569d1d8fedd157101edd0ef4948fd/cpp-redis/cpp_redis/issues/92
og:image:altDescribe the bug When using Redis sentinel - 1 master, 2 duplicates, 3 sentinels - I can always connect to the (curent) writeable master. However, if I 'stop' that service, the next command hangs. ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejgwinner
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/cpp-redis/cpp_redis git https://github.com/cpp-redis/cpp_redis.git
octolytics-dimension-user_id45303665
octolytics-dimension-user_logincpp-redis
octolytics-dimension-repository_id158901124
octolytics-dimension-repository_nwocpp-redis/cpp_redis
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id38889153
octolytics-dimension-repository_parent_nwoCylix/cpp_redis
octolytics-dimension-repository_network_root_id38889153
octolytics-dimension-repository_network_root_nwoCylix/cpp_redis
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
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues/92#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcpp-redis%2Fcpp_redis%2Fissues%2F92
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%2Fcpp-redis%2Fcpp_redis%2Fissues%2F92
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=cpp-redis%2Fcpp_redis
Reloadhttps://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues/92
Reloadhttps://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues/92
Reloadhttps://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues/92
cpp-redis https://patch-diff.githubusercontent.com/cpp-redis
cpp_redishttps://patch-diff.githubusercontent.com/cpp-redis/cpp_redis
Cylix/cpp_redishttps://patch-diff.githubusercontent.com/Cylix/cpp_redis
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fcpp-redis%2Fcpp_redis
Fork 207 https://patch-diff.githubusercontent.com/login?return_to=%2Fcpp-redis%2Fcpp_redis
Star 740 https://patch-diff.githubusercontent.com/login?return_to=%2Fcpp-redis%2Fcpp_redis
Code https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis
Issues 35 https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues
Pull requests 10 https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/pulls
Discussions https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/discussions
Actions https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/actions
Projects 0 https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/projects
Wiki https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/wiki
Security 0 https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/security
Insights https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/pulse
Code https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis
Issues https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues
Pull requests https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/pulls
Discussions https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/discussions
Actions https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/actions
Projects https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/projects
Wiki https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/wiki
Security https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/security
Insights https://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/cpp-redis/cpp_redis/issues/92
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/cpp-redis/cpp_redis/issues/92
Using Redis sentinel, some commands 'send' hangshttps://patch-diff.githubusercontent.com/cpp-redis/cpp_redis/issues/92#top
https://github.com/jgwinner
https://github.com/jgwinner
jgwinnerhttps://github.com/jgwinner
on May 2, 2022https://github.com/cpp-redis/cpp_redis/issues/92#issue-1222476163
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.