Page MenuHomePhabricator

[lib] Set new session if received from fetch_pending_updates
ClosedPublic

Authored by ashoat on Jun 10 2024, 9:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 11:20 PM
Unknown Object (File)
Nov 13 2024, 1:11 AM
Unknown Object (File)
Nov 10 2024, 5:49 PM
Unknown Object (File)
Nov 8 2024, 3:39 PM
Unknown Object (File)
Nov 7 2024, 4:42 PM
Unknown Object (File)
Oct 25 2024, 6:06 PM
Unknown Object (File)
Oct 16 2024, 3:32 PM
Unknown Object (File)
Oct 16 2024, 3:32 PM
Subscribers

Details

Summary

The logic in the keyserver's fetchDataForSocketInit method is written to handle session setting in a peculiar way. The normal session setting mechanisms rely on the result being processed by callSingleKeyserverEndpoint. When a session is set during a socket initialization, the new session is written into the result, and the caller is expected to extract it and handle it manually.

Since fetch_pending_updates is called from callSingleKeyserverEndpoint on the client, we could consider an alternative here, where fetchDataForSocketInit would only behave this way when called from an actual socket (as opposed to fetch_pending_updates). I decided it would be more simple to leave the keyserver code as-is, and to handle the received session on the client side. Open to the alternative if it's preferred.

Depends on D12387

Test Plan

In my test plan in D12386, the socket crash loop would never really get healed, as I had hardcoded the keyserver to timeout. (I was just confirming that fetch_pending_updates was coming in.)

Before I had D12389 in place, each fetch_pending_updates was returning an incremental update. I noticed that the incremental update was always the same (with the same updates being repeated). This was happening because the new session was not setting on the client.

After this diff, that problem went away.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable