Page MenuHomePhabricator

[keyserver] Add a script for triggering socket crash loop
ClosedPublic

Authored by inka on Nov 3 2022, 8:52 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 1:33 PM
Unknown Object (File)
Sun, Apr 14, 1:33 PM
Unknown Object (File)
Sun, Apr 14, 1:33 PM
Unknown Object (File)
Sun, Apr 14, 1:33 PM
Unknown Object (File)
Sun, Apr 14, 1:33 PM
Unknown Object (File)
Sun, Apr 14, 1:29 PM
Unknown Object (File)
Tue, Apr 2, 8:39 PM
Unknown Object (File)
Mar 25 2024, 9:28 AM
Subscribers

Details

Summary

Linear issue: https://linear.app/comm/issue/ENG-2075/reproduce-socket-crash-loop-in-production-with-artificial-test-data
Calling this script in keyserver/ causes 1000 threads to be created under GENESIS with ashoat user and user whos id is specified as spammedUserID.
Having my physical iOS device use 3G this caused a socket crash loop.
Mind that creating 1000 threads takes about 15min.

Test Plan

Set iOS physical device network profile to 3G and run the script in keyserver/
This was tested on 22ac9645d0eb5f83a23a8c1daae0d31ebed5a4a1 D5513

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Nov 3 2022, 9:07 AM
tomek requested changes to this revision.Nov 3 2022, 9:37 AM

This is a little risky to name this script triggerSocketCrashLoop - the name should indicate that we're going to create a lot of new threads. So maybe rename this script and add a comment explaining its purpose.

keyserver/src/scripts/trigger-socket-crash-loop.js
8 ↗(On Diff #18053)

It might be safer to set this to a string that can't be a valid id

11 ↗(On Diff #18053)

Just a nit, really unimportant for a script, but we should prefer returning read only arrays. I we have to use mutable arrays, we can use a shorthand string[].

28 ↗(On Diff #18053)

Can we modify this function to accept also ids of both users?

This revision now requires changes to proceed.Nov 3 2022, 9:37 AM
keyserver/src/scripts/trigger-socket-crash-loop.js
9 ↗(On Diff #18053)

Is this alias really needed?

11 ↗(On Diff #18053)

I actually think it's fine to return writeable arrays in cases like this, where the callee is creating the array for the caller. But it doesn't really matter

This revision is now accepted and ready to land.Nov 4 2022, 3:46 AM