Cap maximum shard size at the size of an integer (#5141)
Cap maximum shard size at the size of an integer (#5141)

Supercedes https://github.com/dask/distributed/pull/5134

Copying over the summary of that PR

Works around the OpenSSL 1.0.2 bug demonstrated in issue ( #4538 ), except unlike PR ( #5115 ) which did this for reading, this does the same thing for writing. The error may be less likely to show up in the write path (as frames may simply be smaller than this limit). Still it seems like a good idea to protect against OverflowErrors from OpenSSL
dask/distributed,dask/distributed,dask/distributed,dask/distributed