Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

uri has not joined space #2116

Open
freesig opened this issue Feb 16, 2020 · 3 comments
Open

uri has not joined space #2116

freesig opened this issue Feb 16, 2020 · 3 comments
Labels

Comments

@freesig
Copy link
Contributor

freesig commented Feb 16, 2020

There's a new error showing up in sim2h that could be a regression.
image
When tracing I found the paths that lead to this error are in the direct message task and these are the two messages that produced the error locally on my machine:
1.

{
  "key": "HandleMessageTask",
  "type": "string",
  "value": 
"Lib3hToClientResponse(SpanWrap(HandleGetGossipingEntryListResult(EntryListData 
{
 space_address: 
SpaceHash(HashString(\"QmSdBdUkuJu6r1cSDKy8mLr96Rsu1sTjeez1juh2bbKGLA\")), 
provider_agent_id: 
AgentPubKey(HashString(\"HcSCJZ7mUgri3tjkzpp4HKBwgec7isw8e6KmdvQukMhpscsjqmgz7XCnC6ah3tz\")), 
request_id: \"\", address_map: {} }), 
Some(EncodedSpanContext([218, 70, 49, 138, 152, 185, 117, 227, 6, 6, 77, 247, 111, 142, 196, 52, 66, 3, 243, 160, 76, 188, 75, 233, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]))))"
}
{
  "key": "HandleMessageTask",
  "type": "string",
  "value": "Lib3hToClientResponse(SpanWrap(HandleGetAuthoringEntryListResult(EntryListData { space_address: 
SpaceHash(HashString(\"QmSdBdUkuJu6r1cSDKy8mLr96Rsu1sTjeez1juh2bbKGLA\")), 
provider_agent_id: 
AgentPubKey(HashString(\"HcSCJZ7mUgri3tjkzpp4HKBwgec7isw8e6KmdvQukMhpscsjqmgz7XCnC6ah3tz\")), 
request_id: \"\", address_map: 
{
EntryHash(HashString(\"HcSCJZ7mUgri3tjkzpp4HKBwgec7isw8e6KmdvQukMhpscsjqmgz7XCnC6ah3tz\")):
 [AspectHash(HashString(\"QmPUXkgZJ9B6r2X7SZwk5px1KcuE8vsH6tmu4ybfwmTa7B\"))], 
EntryHash(HashString(\"Qmd56PnSTVsjcdqfv9NwpKadEADhaE5gfzygNcUSQscGL2\")): 
[AspectHash(HashString(\"QmWrj32wniAQasG6NcfiLVNXf2Jrwj8MtR2FrWBbDD18Df\"))], 
EntryHash(HashString(\"QmZ5u5L8VFZif8HUTCY1LVxZyYLSdChRQ5U2MqUABrzR7g\")): 
[AspectHash(HashString(\"QmPRszXvQBgCk78HDsSgcsBvgD7EHT15VBzwZmCQ4fM9Hh\"))], 
EntryHash(HashString(\"Qme5cAqhVMgKzHAfkZp2wffHqa8r4ASpQ9WCXyJnXPxyAb\")): 
[AspectHash(HashString(\"QmVqRzu5JeEDzjuePHPdbbCPKykewAraDsycATXwAtHAEW\"))]} }), 
Some(EncodedSpanContext([32, 174, 145, 46, 46, 168, 182, 174, 252, 163, 70, 5, 238, 182, 21, 213, 53, 171, 214, 175, 185, 31, 138, 9, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]))))"

}

This was produced with a simple direct message stress test with just two instances.

@freesig freesig added the sim2h label Feb 16, 2020
@freesig
Copy link
Contributor Author

freesig commented Feb 16, 2020

It looks like there is a race condition between Store::new_connection() and Store::get_space_info_from_uri()

@freesig
Copy link
Contributor Author

freesig commented Feb 16, 2020

The self.spaces gets cloned before it's updated by new_connection

@freesig
Copy link
Contributor Author

freesig commented Feb 16, 2020

So I'm fairly confident this is a race issue with when the sim2h_handles state get's cloned.
If you put a 2 second sleep here

then the error doesn't show up.

So basically this error happens when sim2h is running fast not slow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant