Page MenuHomePhabricator

[lib] Set new session if received from fetch_pending_updates
ClosedPublic

Authored by ashoat on Mon, Jun 10, 9:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 29, 8:15 PM
Unknown Object (File)
Fri, Jun 28, 1:05 AM
Unknown Object (File)
Wed, Jun 26, 10:36 PM
Unknown Object (File)
Wed, Jun 26, 3:32 PM
Unknown Object (File)
Wed, Jun 26, 7:12 AM
Unknown Object (File)
Tue, Jun 25, 11:38 AM
Unknown Object (File)
Sun, Jun 16, 2:27 PM
Unknown Object (File)
Sun, Jun 16, 1:10 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