BigPipeResponse objects are not serializable

Created on 21 November 2019, over 5 years ago
Updated 9 November 2023, over 1 year ago

Our Behat tests caught a rather specific issue.
When big_pipe is enabled, the /comment/* route sometimes returns a 500 error.

What happens, is that this call returns a BigPipeResponse object.
And if this response is cacheable, DatabaseBackend will try to serialize it but will faill because BigPipeResponse holds a reference to the DB connection:

[Wed Nov 20 18:10:51.932563 2019] [proxy_fcgi:error] [pid 23899:tid 140516356253440] [client 127.0.0.1:50880] AH01071: Got error 'PHP message: Uncaught PHP Exception LogicException: "The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution." at /home/insite/test/sites/insite-cgscop-extranet-master/web/core/lib/Drupal/Core/Database/Connection.php line 1487\n', referer: http://test.insite-cgscop-extranet.master.d8.insite.coop/prive-pub

Adding DependencySerializationTrait to the BigPipe class seems to fix issue, but I am not sure it is the right way to do it.

πŸ› Bug report
Status

Active

Version

9.5

Component
CacheΒ  β†’

Last updated 12 days ago

Created by

πŸ‡«πŸ‡·France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024