Closed gbrooker closed 5 years ago
Thanks for the fix!
Regarding the TODO comment on not freeing memory you wrote, should we setup a timeout to clear sessions if the pairing does not complete, or a background process to flush out old sessions once per hour ?
Any setup is fine I guess; where the timeout would probably be the overall lower on resources as there won't be unneeded background cleanup going on.
I've been seeing hard crashes due to unsafe access to shared dictionaries from multiple NIO threads in these functions. I've added code to ensure all accesses are thread-safe. The sessions array may be read concurrently, but writes are exclusive.
Regarding the TODO comment on not freeing memory you wrote, should we setup a timeout to clear sessions if the pairing does not complete, or a background process to flush out old sessions once per hour ?