aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-30 18:31:48 +0200
committerKim Alvefur <zash@zash.se>2020-06-30 18:31:48 +0200
commit7d8b2969cc5d61df047c7a6a1e9eb115cec40480 (patch)
treedb17f786029a587c271a16e4c04d775a6d113275 /net
parentcca6ca589f9ac470e704e979b252839a3b121869 (diff)
downloadprosody-7d8b2969cc5d61df047c7a6a1e9eb115cec40480.tar.gz
prosody-7d8b2969cc5d61df047c7a6a1e9eb115cec40480.zip
net.server_epoll: Add setting for turning off callback protections
Might improve (CPU) performance at the risk of triggering top level errors.
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 5ad20371..f767db78 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -74,6 +74,9 @@ local default_config = { __index = {
-- Whether to kill connections in case of callback errors.
fatal_errors = false;
+ -- Or disable protection (like server_select) for potential performance gains
+ protect_listeners = true;
+
-- Attempt writes instantly
opportunistic_writes = false;
}};
@@ -192,6 +195,9 @@ function interface:on(what, ...)
self:noise("Missing listener 'on%s'", what); -- uncomment for development and debugging
return;
end
+ if not cfg.protect_listeners then
+ return listener(self, ...);
+ end
local onerror = self.listeners.onerror or traceback;
local ok, err = xpcall(listener, onerror, self, ...);
if not ok then