Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1162-snmp-Single-threaded-agent-handle-request-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1162-snmp-Single-threaded-agent-handle-request-crash.patch of Package erlang
From fdad9b75a7d0791e6a6ab3c2d3f13b14ebde2671 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Tue, 3 Jan 2023 18:13:00 +0100 Subject: [PATCH 2/2] [snmp] Single threaded agent handle request crash When we are processing a received request (pdu), handle (catch) possible "crashes". Previously, for a multi-threaded agent, the worker (crashing) process was simply restarted (by the master-agent). But for a single threaded agent, the master agent itself crashed. OTP-18379 --- lib/snmp/src/agent/snmpa_agent.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/snmp/src/agent/snmpa_agent.erl b/lib/snmp/src/agent/snmpa_agent.erl index 5039b08391..8caa8200c5 100644 --- a/lib/snmp/src/agent/snmpa_agent.erl +++ b/lib/snmp/src/agent/snmpa_agent.erl @@ -1987,7 +1987,7 @@ handle_pdu(Vsn, Pdu, PduMS, ACMData, Address, GbMaxVBs, Extra, Dict) -> handle_pdu2(Vsn, Pdu, PduMS, ACMData, Address, GbMaxVBs, Extra) -> %% OTP-3324 AuthMod = get(auth_module), - case AuthMod:init_check_access(Pdu, ACMData) of + try AuthMod:init_check_access(Pdu, ACMData) of {ok, MibView, ContextName} -> ?vlog("handle_pdu -> ok:" "~n MibView: ~p" @@ -2005,6 +2005,13 @@ handle_pdu2(Vsn, Pdu, PduMS, ACMData, Address, GbMaxVBs, Extra) -> "~n Reason: ~p", [Variable, Reason]), get(net_if) ! {discarded_pdu, Vsn, Pdu#pdu.request_id, ACMData, Variable, Extra} + catch + Class:Error:Stack -> + ?vinfo("handle_pdu -> crash:" + "~n Class: ~p" + "~n Error: ~p" + "~n Stack: ~p", [Class, Error, Stack]), + handle_acm_error(Vsn, Error, Pdu, ACMData, Address, Extra) end. do_handle_pdu(MibView, Vsn, Pdu, PduMS, -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor