-
Notifications
You must be signed in to change notification settings - Fork 1.5k
changes for making snmp socket non-blocking #3604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pavel-shirshov
merged 1 commit into
sonic-net:master
from
sudhanshukumar22:bgp-snmp-socket-issue
Oct 16, 2019
Merged
changes for making snmp socket non-blocking #3604
pavel-shirshov
merged 1 commit into
sonic-net:master
from
sudhanshukumar22:bgp-snmp-socket-issue
Oct 16, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Can you please split this PR into two? One PR, one patch? |
…ket-issue, origin/bgp-snmp-socket-issue) Author: sudhanshukumar22 <[email protected]> Date: Tue Oct 15 02:31:20 2019 -0700 lib: changes for making snmp socket non-blocking Description: The changes have been done to make the snmp socket non-blocking before calling snmp_read() FRR Pull request: FRRouting/frr#5134 Problem Description/Summary : vtysh hangs on first try to enter after a reboot with BGP dynamic peers Expected Behavior : VTYSH should not hang. When we debug more into bgpd docker by doing gdb on its threads, we find the below thread of bgpd, which is causing the issue. Thread 1 (Thread 0x7f1e1ec46d40 (LWP 47)): 0x00007f1e1d762593 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 0x00007f1e1aadd09b in netsnmp_tcpbase_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aad9617 in netsnmp_transport_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab2c07 in _sess_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab3a29 in snmp_sess_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab3a7b in snmp_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab3acf in snmp_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1b44d7ec in agentx_read (t=0x7fffa75f0080) at lib/agentx.c:63 0x00007f1e1e7d6451 in thread_call (thread=0x7fffa75f0080) at lib/thread.c:1620 0x00007f1e1e770699 in frr_run (master=0x559396ea60f0) at lib/libfrr.c:1011 0x0000559395b4d953 in main (argc=5, argv=0x7fffa75f02b8) at bgpd/bgp_main.c:492 (gdb) bt 0x00007f830c89d210 in __read_nocancel () from /lib/x86_64-linux-gnu/libpthread.so.0 0x000056450e1e8238 in vtysh_client_run (vclient=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:216 0x000056450e1e8c6b in vtysh_client_run_all (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, continue_on_err=0, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:356 0x000056450e1e8ddb in vtysh_client_execute (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable) at vtysh/vtysh.c:393 0x000056450e1e9c82 in vtysh_execute_func (line=0x56450e21add0 enable, pager=0) at vtysh/vtysh.c:598 0x000056450e1e9dee in vtysh_execute_no_pager (line=0x56450e21add0 enable) at vtysh/vtysh.c:619 0x000056450e1f7d48 in vtysh_read_file (confp=0x56451000a9d0, top_cfg=1) at vtysh/vtysh_config.c:494 0x000056450e1f7ef2 in vtysh_read_config (config_default_dir=0x56450e4edc20 <frr_config> /etc/frr/frr.conf, top_cfg=1) at vtysh/vtysh_config.c:522 0x000056450e1e5de4 in vtysh_apply_top_level_config () at vtysh/vtysh_main.c:301 0x000056450e1e7842 in main (argc=2, argv=0x7ffc81e6f598, env=0x7ffc81e6f5b0) at vtysh/vtysh_main.c:692 The fix has been taken from the following link. https://sourceforge.net/p/net-snmp/patches/1348/
4ea6caf
to
6d74a22
Compare
Hi Pavel, |
pavel-shirshov
approved these changes
Oct 16, 2019
praveen-li
pushed a commit
to praveen-li/sonic-buildimage
that referenced
this pull request
Feb 9, 2021
…ket-issue, origin/bgp-snmp-socket-issue) (sonic-net#3604) Author: sudhanshukumar22 <[email protected]> Date: Tue Oct 15 02:31:20 2019 -0700 lib: changes for making snmp socket non-blocking Description: The changes have been done to make the snmp socket non-blocking before calling snmp_read() FRR Pull request: FRRouting/frr#5134 Problem Description/Summary : vtysh hangs on first try to enter after a reboot with BGP dynamic peers Expected Behavior : VTYSH should not hang. When we debug more into bgpd docker by doing gdb on its threads, we find the below thread of bgpd, which is causing the issue. Thread 1 (Thread 0x7f1e1ec46d40 (LWP 47)): 0x00007f1e1d762593 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0 0x00007f1e1aadd09b in netsnmp_tcpbase_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aad9617 in netsnmp_transport_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab2c07 in _sess_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab3a29 in snmp_sess_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab3a7b in snmp_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1aab3acf in snmp_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30 0x00007f1e1b44d7ec in agentx_read (t=0x7fffa75f0080) at lib/agentx.c:63 0x00007f1e1e7d6451 in thread_call (thread=0x7fffa75f0080) at lib/thread.c:1620 0x00007f1e1e770699 in frr_run (master=0x559396ea60f0) at lib/libfrr.c:1011 0x0000559395b4d953 in main (argc=5, argv=0x7fffa75f02b8) at bgpd/bgp_main.c:492 (gdb) bt 0x00007f830c89d210 in __read_nocancel () from /lib/x86_64-linux-gnu/libpthread.so.0 0x000056450e1e8238 in vtysh_client_run (vclient=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:216 0x000056450e1e8c6b in vtysh_client_run_all (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, continue_on_err=0, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:356 0x000056450e1e8ddb in vtysh_client_execute (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable) at vtysh/vtysh.c:393 0x000056450e1e9c82 in vtysh_execute_func (line=0x56450e21add0 enable, pager=0) at vtysh/vtysh.c:598 0x000056450e1e9dee in vtysh_execute_no_pager (line=0x56450e21add0 enable) at vtysh/vtysh.c:619 0x000056450e1f7d48 in vtysh_read_file (confp=0x56451000a9d0, top_cfg=1) at vtysh/vtysh_config.c:494 0x000056450e1f7ef2 in vtysh_read_config (config_default_dir=0x56450e4edc20 <frr_config> /etc/frr/frr.conf, top_cfg=1) at vtysh/vtysh_config.c:522 0x000056450e1e5de4 in vtysh_apply_top_level_config () at vtysh/vtysh_main.c:301 0x000056450e1e7842 in main (argc=2, argv=0x7ffc81e6f598, env=0x7ffc81e6f5b0) at vtysh/vtysh_main.c:692 The fix has been taken from the following link. https://sourceforge.net/p/net-snmp/patches/1348/ Signed-off-by: Zhenggen Xu <[email protected]> RB=2119458 G=lnos-reviewers R=pchaudhary,pmao,vapatil,samaity,zxu A=
praveen-li
pushed a commit
to praveen-li/sonic-buildimage
that referenced
this pull request
Feb 9, 2021
…snmp-socket-issue, origin/bgp-snmp-socket-issue) (sonic-net#3604)" This reverts commit 5119971.
mssonicbld
added a commit
that referenced
this pull request
Apr 19, 2025
…lly (#22378) #### Why I did it src/sonic-swss ``` * e0b2ac61 - (HEAD -> master, origin/master, origin/HEAD) swss: Align STP structures and remove GCC diagnostic pragmas (#3440) (3 hours ago) [Omar Tamer] * 120ed90a - [fgnhgorch] Fix incorrect state DB updates due to unordered field-val… (#3566) (3 hours ago) [InspurSDN] * 1552e340 - Move timestamps out of counter table to avoid update too frequently (#3585) (6 hours ago) [Stephen Sun] * 73e534c3 - Initialize the last fec ber computed values if not found (#3604) (27 hours ago) [Prince George] * 504daa19 - [az] Install vpp artifacts (#3609) (27 hours ago) [Kamil Cudnik] * bc750a5a - [orchagent] Add value validation for RouteOrch, NhgOrch and Srv6Orch (#3596) (4 days ago) [Yuqing Zhao(Alibaba Inc)] * d1fb9f7f - [DASH] Dash tunnel/PL NSG implementation (#3543) (4 days ago) [Lawrence Lee] * ffc865e6 - Fix a pipeline issue due to dependency in docker-sonic-vs (#3603) (4 days ago) [Dashuai Zhang] * f7ca83d2 - Fix the missed port status notifications issue (#3595) (7 days ago) [Vivek] * 5592fbe0 - [portsorch] pass oper status at hostif creation (#3563) (7 days ago) [Stepan Blyshchak] * 7bcd21c7 - [orchagent] Fix issue: typo in high BER (#3600) (8 days ago) [Junchao-Mellanox] * 3e1f8d8f - [portmgrd] regression: prevent runtime exception (crash) in configuring portchannel at boot (#3432) (8 days ago) [Brad House] * 492a85ae - [DASH] Make DASH vnet orch bulk logic consistent (#3554) (2 weeks ago) [Lawrence Lee] * 822ab913 - Handle outbound_direction_lookup for DASH_APPLIANCE_TABLE (#3571) (3 weeks ago) [prabhataravind] * fe9b89e4 - [DVS] Remove framework package during DVS build (#3577) (3 weeks ago) [Lawrence Lee] * 596d88c1 - Added Change for given Route ECMP to fallback on Default Route ECMP (#3389) (3 weeks ago) [abdosi] * d35c1c77 - Initialize number of counters to 0 before querying the capabilities (#3546) (5 weeks ago) [Stephen Sun] * 0e0685ae - Fix the switch level Voq counter to use switch_id Oid instead of counter name for PACKET_INTEGRITY counter (#3521) (5 weeks ago) [saksarav-nokia] * ee38b39e - [BFD] Change capability check to get. (#3559) (5 weeks ago) [dypet] * 45fdedb9 - Prevent lossless profile creation for 0m cable (#3548) (5 weeks ago) [Jianyue Wu] ``` #### How I did it #### How to verify it #### Description for the changelog
yanjundeng
pushed a commit
to yanjundeng/sonic-buildimage
that referenced
this pull request
Apr 23, 2025
…lly (sonic-net#22378) #### Why I did it src/sonic-swss ``` * e0b2ac61 - (HEAD -> master, origin/master, origin/HEAD) swss: Align STP structures and remove GCC diagnostic pragmas (sonic-net#3440) (3 hours ago) [Omar Tamer] * 120ed90a - [fgnhgorch] Fix incorrect state DB updates due to unordered field-val… (sonic-net#3566) (3 hours ago) [InspurSDN] * 1552e340 - Move timestamps out of counter table to avoid update too frequently (sonic-net#3585) (6 hours ago) [Stephen Sun] * 73e534c3 - Initialize the last fec ber computed values if not found (sonic-net#3604) (27 hours ago) [Prince George] * 504daa19 - [az] Install vpp artifacts (sonic-net#3609) (27 hours ago) [Kamil Cudnik] * bc750a5a - [orchagent] Add value validation for RouteOrch, NhgOrch and Srv6Orch (sonic-net#3596) (4 days ago) [Yuqing Zhao(Alibaba Inc)] * d1fb9f7f - [DASH] Dash tunnel/PL NSG implementation (sonic-net#3543) (4 days ago) [Lawrence Lee] * ffc865e6 - Fix a pipeline issue due to dependency in docker-sonic-vs (sonic-net#3603) (4 days ago) [Dashuai Zhang] * f7ca83d2 - Fix the missed port status notifications issue (sonic-net#3595) (7 days ago) [Vivek] * 5592fbe0 - [portsorch] pass oper status at hostif creation (sonic-net#3563) (7 days ago) [Stepan Blyshchak] * 7bcd21c7 - [orchagent] Fix issue: typo in high BER (sonic-net#3600) (8 days ago) [Junchao-Mellanox] * 3e1f8d8f - [portmgrd] regression: prevent runtime exception (crash) in configuring portchannel at boot (sonic-net#3432) (8 days ago) [Brad House] * 492a85ae - [DASH] Make DASH vnet orch bulk logic consistent (sonic-net#3554) (2 weeks ago) [Lawrence Lee] * 822ab913 - Handle outbound_direction_lookup for DASH_APPLIANCE_TABLE (sonic-net#3571) (3 weeks ago) [prabhataravind] * fe9b89e4 - [DVS] Remove framework package during DVS build (sonic-net#3577) (3 weeks ago) [Lawrence Lee] * 596d88c1 - Added Change for given Route ECMP to fallback on Default Route ECMP (sonic-net#3389) (3 weeks ago) [abdosi] * d35c1c77 - Initialize number of counters to 0 before querying the capabilities (sonic-net#3546) (5 weeks ago) [Stephen Sun] * 0e0685ae - Fix the switch level Voq counter to use switch_id Oid instead of counter name for PACKET_INTEGRITY counter (sonic-net#3521) (5 weeks ago) [saksarav-nokia] * ee38b39e - [BFD] Change capability check to get. (sonic-net#3559) (5 weeks ago) [dypet] * 45fdedb9 - Prevent lossless profile creation for 0m cable (sonic-net#3548) (5 weeks ago) [Jianyue Wu] ``` #### How I did it #### How to verify it #### Description for the changelog
vidyac86
pushed a commit
to vidyac86/sonic-buildimage
that referenced
this pull request
Apr 23, 2025
…lly (sonic-net#22378) #### Why I did it src/sonic-swss ``` * e0b2ac61 - (HEAD -> master, origin/master, origin/HEAD) swss: Align STP structures and remove GCC diagnostic pragmas (sonic-net#3440) (3 hours ago) [Omar Tamer] * 120ed90a - [fgnhgorch] Fix incorrect state DB updates due to unordered field-val… (sonic-net#3566) (3 hours ago) [InspurSDN] * 1552e340 - Move timestamps out of counter table to avoid update too frequently (sonic-net#3585) (6 hours ago) [Stephen Sun] * 73e534c3 - Initialize the last fec ber computed values if not found (sonic-net#3604) (27 hours ago) [Prince George] * 504daa19 - [az] Install vpp artifacts (sonic-net#3609) (27 hours ago) [Kamil Cudnik] * bc750a5a - [orchagent] Add value validation for RouteOrch, NhgOrch and Srv6Orch (sonic-net#3596) (4 days ago) [Yuqing Zhao(Alibaba Inc)] * d1fb9f7f - [DASH] Dash tunnel/PL NSG implementation (sonic-net#3543) (4 days ago) [Lawrence Lee] * ffc865e6 - Fix a pipeline issue due to dependency in docker-sonic-vs (sonic-net#3603) (4 days ago) [Dashuai Zhang] * f7ca83d2 - Fix the missed port status notifications issue (sonic-net#3595) (7 days ago) [Vivek] * 5592fbe0 - [portsorch] pass oper status at hostif creation (sonic-net#3563) (7 days ago) [Stepan Blyshchak] * 7bcd21c7 - [orchagent] Fix issue: typo in high BER (sonic-net#3600) (8 days ago) [Junchao-Mellanox] * 3e1f8d8f - [portmgrd] regression: prevent runtime exception (crash) in configuring portchannel at boot (sonic-net#3432) (8 days ago) [Brad House] * 492a85ae - [DASH] Make DASH vnet orch bulk logic consistent (sonic-net#3554) (2 weeks ago) [Lawrence Lee] * 822ab913 - Handle outbound_direction_lookup for DASH_APPLIANCE_TABLE (sonic-net#3571) (3 weeks ago) [prabhataravind] * fe9b89e4 - [DVS] Remove framework package during DVS build (sonic-net#3577) (3 weeks ago) [Lawrence Lee] * 596d88c1 - Added Change for given Route ECMP to fallback on Default Route ECMP (sonic-net#3389) (3 weeks ago) [abdosi] * d35c1c77 - Initialize number of counters to 0 before querying the capabilities (sonic-net#3546) (5 weeks ago) [Stephen Sun] * 0e0685ae - Fix the switch level Voq counter to use switch_id Oid instead of counter name for PACKET_INTEGRITY counter (sonic-net#3521) (5 weeks ago) [saksarav-nokia] * ee38b39e - [BFD] Change capability check to get. (sonic-net#3559) (5 weeks ago) [dypet] * 45fdedb9 - Prevent lossless profile creation for 0m cable (sonic-net#3548) (5 weeks ago) [Jianyue Wu] ``` #### How I did it #### How to verify it #### Description for the changelog
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Patch 1:
0006-changes-for-making-snmp-socket-non-blocking.patch
Description: The changes have been done to make the snmp socket
non-blocking before calling snmp_read()
FRR Pull request: FRRouting/frr#5134
Problem Description/Summary :
vtysh hangs on first try to enter after a reboot with BGP dynamic peers
Expected Behavior :
VTYSH should not hang.
When we debug more into bgpd docker by doing gdb on its threads, we find the below thread of bgpd, which is causing the issue.
Thread 1 (Thread 0x7f1e1ec46d40 (LWP 47)):
0x00007f1e1d762593 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0
0x00007f1e1aadd09b in netsnmp_tcpbase_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aad9617 in netsnmp_transport_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab2c07 in _sess_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab3a29 in snmp_sess_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab3a7b in snmp_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab3acf in snmp_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1b44d7ec in agentx_read (t=0x7fffa75f0080) at lib/agentx.c:63
0x00007f1e1e7d6451 in thread_call (thread=0x7fffa75f0080) at lib/thread.c:1620
0x00007f1e1e770699 in frr_run (master=0x559396ea60f0) at lib/libfrr.c:1011
0x0000559395b4d953 in main (argc=5, argv=0x7fffa75f02b8) at bgpd/bgp_main.c:492
(gdb) bt
0x00007f830c89d210 in __read_nocancel () from /lib/x86_64-linux-gnu/libpthread.so.0
0x000056450e1e8238 in vtysh_client_run (vclient=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:216
0x000056450e1e8c6b in vtysh_client_run_all (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, continue_on_err=0, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:356
0x000056450e1e8ddb in vtysh_client_execute (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable) at vtysh/vtysh.c:393
0x000056450e1e9c82 in vtysh_execute_func (line=0x56450e21add0 enable, pager=0) at vtysh/vtysh.c:598
0x000056450e1e9dee in vtysh_execute_no_pager (line=0x56450e21add0 enable) at vtysh/vtysh.c:619
0x000056450e1f7d48 in vtysh_read_file (confp=0x56451000a9d0, top_cfg=1) at vtysh/vtysh_config.c:494
0x000056450e1f7ef2 in vtysh_read_config (config_default_dir=0x56450e4edc20 <frr_config> /etc/frr/frr.conf, top_cfg=1) at vtysh/vtysh_config.c:522
0x000056450e1e5de4 in vtysh_apply_top_level_config () at vtysh/vtysh_main.c:301
0x000056450e1e7842 in main (argc=2, argv=0x7ffc81e6f598, env=0x7ffc81e6f5b0) at vtysh/vtysh_main.c:692
The fix has been taken from the following link.
https://sourceforge.net/p/net-snmp/patches/1348/
Patch 2:
0007-prevent-dead-fd-poll-data-port-fix-from-frr.patch
Port a fix from FRR community
donaldsharp/frr@39c93f3
If we have a case where have created a fd for i/o and we have removed the
handling thread but still have the fd in the poll data structure, there
existed a case where we would get the handle this fd return from poll but we
would immediately do nothing with it because we didn't have a thread to hand
the event to.
This leads to an infinite loop. Prevent the infinite loop
from happening and log the problem.
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)