SQL crashing

Public

PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => theme_registry:runtime:seven:cache ) in lock_may_be_available().

This issue can be fixed on the database configuration. In mysql the parameter is max_allowed_packet.

I had to change it to be max_allowed_packet=256MB.

I still don't like the solution, not sure if this should be fixed in the code, maybe splitting the cache inserts to be smaller.

Get raw version
sql
  1. mysql -u root -p
  2. SET GLOBAL max_allowed_packet=256*1024*1024;
  3. SHOW VARIABLES LIKE 'max%' ;