René's URL Explorer Experiment


Title: Broken pipe (close_after=true) or endless retry loop (close_after=false) when exchanging classical messages · Issue #58 · SoftwareQuTech/CQC-Python · GitHub

Open Graph Title: Broken pipe (close_after=true) or endless retry loop (close_after=false) when exchanging classical messages · Issue #58 · SoftwareQuTech/CQC-Python

X Title: Broken pipe (close_after=true) or endless retry loop (close_after=false) when exchanging classical messages · Issue #58 · SoftwareQuTech/CQC-Python

Description: There is a race condition in the way classical channels are handled in Simulaqron that causes BrokenPipe errors. It happens when node A sends two classical messages to node B in succession. So, in node A we have: A1) sendClassical("B", "...

Open Graph Description: There is a race condition in the way classical channels are handled in Simulaqron that causes BrokenPipe errors. It happens when node A sends two classical messages to node B in succession. So, in ...

X Description: There is a race condition in the way classical channels are handled in Simulaqron that causes BrokenPipe errors. It happens when node A sends two classical messages to node B in succession. So, in ...

Opengraph URL: https://github.com/SoftwareQuTech/CQC-Python/issues/58

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Broken pipe (close_after=true) or endless retry loop (close_after=false) when exchanging classical messages","articleBody":"There is a race condition in the way classical channels are handled in Simulaqron that causes BrokenPipe errors.\r\n\r\nIt happens when node A sends two classical messages to node B in succession.\r\n\r\nSo, in node A we have:\r\nA1) sendClassical(\"B\", \"msg1\")\r\nA2) sendClassical(\"B\", \"msg2\")\r\n\r\nAnd in node B we have:\r\nB1) msg1 = recvClassical()\r\nB2) msg2 = recvClassical()\r\n\r\nWe have close_after set to the default value False in all calls.\r\n\r\nThe following sequence of events takes place:\r\n\r\nIn step A1, node A tries to connect to node B. This fails because node A has not yet created a listening socket. A keeps retrying.\r\n\r\nIn step B1, node B creates a listening socket \"s\" and waits for incoming connections. An incoming connection from A does indeed arrive, and node B accepts it which creates a connection socket \"conn\" (in addition to the listening socket).\r\n\r\nIn step A1, node A finally connects successfully and sends msg1.\r\n\r\nIn step A1, node A closes the connection to B.\r\n\r\nIn step A2, node A tries to connect to node B to send the second message msg2. This succeeds, because node B is still in step B1 and has not yet closed the listening socket for the first message.\r\n\r\nIn step B1, node B, receives msg1 from node A. After receiving msg1, node B closes connection socket conn (in function closeClassicalServer) but the listen socket is not explicitly closed. The listening socket which is still open still has a pending incoming connection from event 5 above.\r\n\r\nIn step B2, calls startClassicalServer again for the second incoming message. This creates a new listening socket \"s\" for the same port. This evidently has the side effect of causing the first listening socket which was never explicitly closed to be closed implicitly. Whatever, at this point node B gets a BrokenPipe error because the pending connection failed to complete.\r\n\r\nActually, the listening socket is probably closed when \"s\" goes out of scope when startClassicalServer exits the function. But still, the net result is the same. By this time, node A has already started sending msg2 and has already connected to this listening socket before it was closed. Thus, node A will get the BrokenPipe when the listening socket (which was intended for msg1 but which accidentally used for msg2 as well) gets closed.\r\n\r\nSimulaqron PythonLib should not be creating new listening sockets for every received message. There should only be one listening socket, and it should be used for the lifetime of the node.\r\n\r\nNote: if I set close_after to False in sendClassical and recvClassical, we run into another bug. We get stuck in an endless loop \"App Alice: Could not open classical channel to Eve, trying again..\" This is because PythonLib cannot handle having two simultaneous TCP connections to two different neighbor nodes (e.g. Eve having two connections, one to Alice and one to Bob) if close_after is False.\r\n\r\nIn general, the handling of sockets for classical messages is in need of some cleaning up.\r\n\r\nPS: All this opening and closing of sockets probably makes the protocols run quite slowly. We should make close_after=False the default and fix the code so that it can handle multiple simultaneous connections to multiple neighboring nodes.\r\n\r\n@AckslD If you would like me to give shot at fixing this myself, feel free to assign the issue to me. Or assign it to yourself if you prefer handling it yourself. If the former, it appears that there is no unit test library for pythonLib... is that correct?","author":{"url":"https://github.com/brunorijsman","@type":"Person","name":"brunorijsman"},"datePublished":"2019-12-06T14:00:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/58/CQC-Python/issues/58"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ec5f0b29-e04d-3beb-7006-0817f23dcd3e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDA2A:16035E:BC9AE:10617B:6981CF8A
html-safe-nonce1436edcdf7500315c2975dabab23a0c75cd9485f28765ac0c0c06c9f220d5507
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTJBOjE2MDM1RTpCQzlBRToxMDYxN0I6Njk4MUNGOEEiLCJ2aXNpdG9yX2lkIjoiNjI2NTU2MTMyMTgxOTk4Mzc1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac85d943e5a28c1abcae60a36d415592f1d9ff969fc470a898c0774801d11d0b73
hovercard-subject-tagissue:534006550
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/SoftwareQuTech/CQC-Python/58/issue_layout
twitter:imagehttps://opengraph.githubassets.com/40824f67364878b7f1f2ad9ddfbaeb7556a17469304527ca11946094e5f2cc10/SoftwareQuTech/CQC-Python/issues/58
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/40824f67364878b7f1f2ad9ddfbaeb7556a17469304527ca11946094e5f2cc10/SoftwareQuTech/CQC-Python/issues/58
og:image:altThere is a race condition in the way classical channels are handled in Simulaqron that causes BrokenPipe errors. It happens when node A sends two classical messages to node B in succession. So, in ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebrunorijsman
hostnamegithub.com
expected-hostnamegithub.com
Noneebfdf8d3e0fd17b103f41cc6696d84938694ebebdfecaf11fe00dbe4a9785801
turbo-cache-controlno-preview
go-importgithub.com/SoftwareQuTech/CQC-Python git https://github.com/SoftwareQuTech/CQC-Python.git
octolytics-dimension-user_id43809204
octolytics-dimension-user_loginSoftwareQuTech
octolytics-dimension-repository_id177956316
octolytics-dimension-repository_nwoSoftwareQuTech/CQC-Python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id177956316
octolytics-dimension-repository_network_root_nwoSoftwareQuTech/CQC-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
releaseac96edcf00b294dfaa8f1b86d06a198589e60041
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues/58#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSoftwareQuTech%2FCQC-Python%2Fissues%2F58
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%2FSoftwareQuTech%2FCQC-Python%2Fissues%2F58
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=SoftwareQuTech%2FCQC-Python
Reloadhttps://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues/58
Reloadhttps://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues/58
Reloadhttps://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues/58
SoftwareQuTech https://patch-diff.githubusercontent.com/SoftwareQuTech
CQC-Pythonhttps://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FSoftwareQuTech%2FCQC-Python
Fork 10 https://patch-diff.githubusercontent.com/login?return_to=%2FSoftwareQuTech%2FCQC-Python
Star 22 https://patch-diff.githubusercontent.com/login?return_to=%2FSoftwareQuTech%2FCQC-Python
Code https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python
Issues 7 https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues
Pull requests 0 https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/pulls
Actions https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/actions
Projects 0 https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/projects
Security 0 https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/security
Insights https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/pulse
Code https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python
Issues https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues
Pull requests https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/pulls
Actions https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/actions
Projects https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/projects
Security https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/security
Insights https://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/SoftwareQuTech/CQC-Python/issues/58
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/SoftwareQuTech/CQC-Python/issues/58
Broken pipe (close_after=true) or endless retry loop (close_after=false) when exchanging classical messageshttps://patch-diff.githubusercontent.com/SoftwareQuTech/CQC-Python/issues/58#top
https://patch-diff.githubusercontent.com/brunorijsman
https://github.com/brunorijsman
https://github.com/brunorijsman
brunorijsmanhttps://github.com/brunorijsman
on Dec 6, 2019https://github.com/SoftwareQuTech/CQC-Python/issues/58#issue-534006550
@AckslDhttps://github.com/AckslD
brunorijsmanhttps://patch-diff.githubusercontent.com/brunorijsman
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.