avalonmediasystem / avalon

Avalon Media System – Samvera Application
http://www.avalonmediasystem.org/
Apache License 2.0
93 stars 51 forks source link

Limit the number of stream tokens in a user session to avoid SessionOverflow errors #5882

Closed cjcolvar closed 2 weeks ago

cjcolvar commented 2 weeks ago

Resolves #5377

This PR limits the number of stream tokens in a session to avoid overflowing the session's data column in the database. The data column is type text which means that for MySql it is up to 65,535 bytes. Given that each stream token is 40 characters I think the session could only hold 1,638 tokens (65,535 / 40 = 1638.375) even if it wasn't storing any other information. In testing though, my session on MCO-staging could only store 910 tokens before it overflowed. Given this I added a migration to increase the limit of the text column to medium text which can store up to 16MB instead of 64KB. This larger size will accomodate the requested limit of 2,000 tokens and should avoid SessionOverflow errors for the foreseeable future.