Commit 38b77287 authored by Luca Bigliardi's avatar Luca Bigliardi
Browse files

Lock node daemon children in memory


Signed-off-by: default avatarLuca Bigliardi <shammash@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 02bea2fc
......@@ -92,6 +92,17 @@ def _RequireJobQueueLock(fn):
return wrapper
class MlockallRequestExecutor(http.server.HttpServerRequestExecutor):
"""Custom Request Executor class that ensures NodeHttpServer children are
locked in ram.
"""
def __init__(self, *args, **kwargs):
utils.Mlockall()
http.server.HttpServerRequestExecutor.__init__(self, *args, **kwargs)
class NodeHttpServer(http.server.HttpServer):
"""The server implementation.
......@@ -851,7 +862,8 @@ def ExecNoded(options, _):
mainloop = daemon.Mainloop()
server = NodeHttpServer(mainloop, options.bind_address, options.port,
ssl_params=ssl_params, ssl_verify_peer=True)
ssl_params=ssl_params, ssl_verify_peer=True,
request_executor_class=MlockallRequestExecutor)
server.Start()
try:
mainloop.Run()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment