jmarantz commented on issue #1775: Deadlock in shm statistics URL: https://github.com/apache/incubator-pagespeed-mod/issues/1775#issuecomment-394815618 I don't think a notification strategy would help; MPS doesn't hold stats-locks for very long; there's no message handling loop during a stats update to receive such a notification. Example code: https://github.com/apache/incubator-pagespeed-mod/blob/e7f30337cc33d4f9b8873b0b0b073a8f17706bdd/pagespeed/kernel/base/statistics.cc#L105 Spawning a process for background optimizations would be a pretty complex architectural change and I doubt anyone has the time to do it., though actually I've considered that in the past as an option given the new controller process. I really don't know much about ITK but I thought maybe processes could be made to linger for a while handling the requests for a single user, without having to revert to root. I'll consider that avenue dead, but still propose extending MPS's deadlines to make the failure scenario less likely. That's the easiest thing to try because it's just tweaking a couple of pagespeed configuration options. But I really think -- without extensive new development -- @oschaaf's idea of putting a proxy (e.g. https://github.com/We-Amp/ats_pagespeed or ngx_pagespeed) downstream of the ITK-enabled server, is the best one. You'd have to set it up to proxy all the different hosts handled by Apache though, which would of course need to be maintained. More food for thought for the future: PageSpeed's usage of shared-memory mutexes for stats is not the only solution. Envoy Proxy also has shared-mem stats but uses [atomics](https://github.com/envoyproxy/envoy/blob/759eacbde057dd06cfb84d016a8da1e8087154d2/source/common/stats/stats_impl.h#L251). That doesn't address histograms or PageSpeed's shared-memory metadata cache, but it might address the most common case of cross-process deadlocks when used with ITK.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
