我已经检查出Hanami,发现我的续集的连接使用下列错误垂死:分叉时,续集丢失SSL连接错误,为什么?
Sequel::DatabaseDisconnectError: PG::ConnectionBad: PQconsumeInput() SSL error: decryption failed or bad record mac: SELECT NULL
无论服务器(薄,彪马,webrick)方式或环境。经过一番实验,结果证明匪徒在Gemfile
(hanami不重新载入代码)。从猎枪文档:
Each time a request is received, it forks, loads the application in the child process, processes the request, and exits the child process.
当生产与使用nginx的,分叉续集下降出于同样的原因连接。
这可以用下面的代码来改善,但是这将意味着人们必须重新对每个请求:
SequelDB.extension :connection_validator
SequelDB.pool.connection_validation_timeout = -1
如此看来,分叉后续集的连接池已损坏。
为什么续集这样做?