Don't use singleton in routes.middleware.RoutesMiddleware
It seems that using default singleton=True in the
routes.middleware.RoutesMiddleware which is leading to use thread-local
RequestConfig singleton object is not working well with eventlet
monkeypatching of threading library which we are doing in Neutron.
As a result it leaks memory in neutron-api workers every time when API
request to not existing API endpoint is made by user.
To avoid that memory leak, let's use singletone=False in that
RoutesMiddleware object, at least until problem with thread-local
singleton and eventlet monkey patching will be solved.
Closes-Bug: #1942179
Change-Id: Id3a529248d3984506f0166bdc32e334127a01b7b
(cherry picked from commit e610a5eb9e71aa2549fb11e2139370d227787da2)
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/807632 /opendev. org/openstack/ neutron/ commit/ c5e86f4f8f7e362 33f383323e24e72 dbe28efc04
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/wallaby
commit c5e86f4f8f7e362 33f383323e24e72 dbe28efc04
Author: Slawek Kaplonski <email address hidden>
Date: Fri Sep 3 16:04:02 2021 +0200
Don't use singleton in routes. middleware. RoutesMiddlewar e
It seems that using default singleton=True in the middleware. RoutesMiddlewar e which is leading to use thread-local
routes.
RequestConfig singleton object is not working well with eventlet
monkeypatching of threading library which we are doing in Neutron.
As a result it leaks memory in neutron-api workers every time when API
request to not existing API endpoint is made by user.
To avoid that memory leak, let's use singletone=False in that eware object, at least until problem with thread-local
RoutesMiddl
singleton and eventlet monkey patching will be solved.
Closes-Bug: #1942179 506f0166bdc32e3 34127a01b7b 549fb11e2139370 d227787da2)
Change-Id: Id3a529248d3984
(cherry picked from commit e610a5eb9e71aa2