Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
List overview
Download
cluster-commits
May 2015
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
cluster-commits@lists.stg.fedorahosted.org
1 participants
2 discussions
Start a n
N
ew thread
cluster: RHEL6 - gfs_controld: Retry uevent recv() and reconnect uevent socket on error
by jruemker
27 May '15
27 May '15
Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=353cec33e438d…
Commit: 353cec33e438d32a4be1a3eeb165abad57133864 Parent: 40b2dfa44ac95304d5e8caafe8e243b8ac75233c Author: John Ruemker <jruemker(a)redhat.com> AuthorDate: Wed May 27 16:01:39 2015 -0400 Committer: John Ruemker <jruemker(a)redhat.com> CommitterDate: Wed May 27 16:01:39 2015 -0400 gfs_controld: Retry uevent recv() and reconnect uevent socket on error When processing a uevent, on ENOBUFS retry up to three times before giving up. For other errors besides EAGAIN and EINTR, or after the maximum ENOBUFS retries, reconnect the uevent netlink socket. --- group/gfs_controld/main.c | 75 +++++++++++++++++++++++++++----------------- 1 files changed, 46 insertions(+), 29 deletions(-) diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c index dc841da..c27b192 100644 --- a/group/gfs_controld/main.c +++ b/group/gfs_controld/main.c @@ -8,6 +8,7 @@ #define LOCKFILE_NAME "/var/run/gfs_controld.pid" #define CLIENT_NALLOC 32 #define UEVENT_BUF_SIZE 4096 +#define MAX_UEVENT_NOBUFS 3 static int client_maxi; static int client_size; @@ -291,20 +292,62 @@ static char *uevent_fsname(const char *vars[]) return (name && name[0]) ? name + 1 : NULL; } +static int setup_uevent(void) +{ + struct sockaddr_nl snl; + int s, rv; + + s = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); + if (s < 0) { + log_error("uevent netlink socket"); + return s; + } + + memset(&snl, 0, sizeof(snl)); + snl.nl_family = AF_NETLINK; + snl.nl_pid = getpid(); + snl.nl_groups = 1; + + rv = bind(s, (struct sockaddr *) &snl, sizeof(snl)); + if (rv < 0) { + log_error("uevent bind error %d errno %d", rv, errno); + close(s); + return rv; + } + + return s; +} + static void process_uevent(int ci) { char buf[UEVENT_BUF_SIZE]; const char *uevent_vals[Env_Last]; char *fsname; - int rv; + int rv, nobufs = 0; retry_recv: rv = recv(client[ci].fd, &buf, sizeof(buf), 0); if (rv < 0) { + log_error("uevent recv error %d errno %d", rv, errno); if (errno == EINTR) goto retry_recv; - if (errno != EAGAIN) - log_error("uevent recv error %d errno %d", rv, errno); + if (errno == ENOBUFS && nobufs < MAX_UEVENT_NOBUFS) { + pollfd[ci].revents &= ~POLLERR; + nobufs++; + goto retry_recv; + } + if (errno != EAGAIN) { + close(client[ci].fd); + rv = setup_uevent(); + if (rv < 0) { + /* revent error will trigger cleanup by loop */ + return; + } + client[ci].fd = rv; + pollfd[ci].fd = rv; + pollfd[ci].revents = 0; + log_debug("uevent socket reconnected"); + } return; } buf[rv] = 0; @@ -375,32 +418,6 @@ static void process_uevent(int ci) } } -static int setup_uevent(void) -{ - struct sockaddr_nl snl; - int s, rv; - - s = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); - if (s < 0) { - log_error("uevent netlink socket"); - return s; - } - - memset(&snl, 0, sizeof(snl)); - snl.nl_family = AF_NETLINK; - snl.nl_pid = getpid(); - snl.nl_groups = 1; - - rv = bind(s, (struct sockaddr *) &snl, sizeof(snl)); - if (rv < 0) { - log_error("uevent bind error %d errno %d", rv, errno); - close(s); - return rv; - } - - return s; -} - static void init_header(struct gfsc_header *h, int cmd, char *name, int result, int extra_len) {
1
0
0
0
cluster: RHEL6 - dlm_controld: Retry uevent recv() and reconnect uevent socket on error
by jruemker
27 May '15
27 May '15
Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=40b2dfa44ac95…
Commit: 40b2dfa44ac95304d5e8caafe8e243b8ac75233c Parent: 090957641013f2362f8fbb99ad30eb4b25a4f54e Author: John Ruemker <jruemker(a)redhat.com> AuthorDate: Wed May 27 10:04:55 2015 -0400 Committer: John Ruemker <jruemker(a)redhat.com> CommitterDate: Wed May 27 10:04:55 2015 -0400 dlm_controld: Retry uevent recv() and reconnect uevent socket on error When processing a uevent, on ENOBUFS retry up to three times before giving up. For other errors besides EAGAIN and EINTR, or after the maximum ENOBUFS retries, reconnect the uevent netlink socket. --- group/dlm_controld/main.c | 75 +++++++++++++++++++++++++++----------------- 1 files changed, 46 insertions(+), 29 deletions(-) diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c index eeab77c..9b60007 100644 --- a/group/dlm_controld/main.c +++ b/group/dlm_controld/main.c @@ -10,6 +10,7 @@ #define LOCKFILE_NAME "/var/run/dlm_controld.pid" #define CLIENT_NALLOC 32 +#define MAX_UEVENT_NOBUFS 3 static int client_maxi; static int client_size = 0; @@ -290,6 +291,32 @@ const char *dlm_mode_str(int mode) return "??"; } +static int setup_uevent(void) +{ + struct sockaddr_nl snl; + int s, rv; + + s = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); + if (s < 0) { + log_error("uevent netlink socket"); + return s; + } + + memset(&snl, 0, sizeof(snl)); + snl.nl_family = AF_NETLINK; + snl.nl_pid = getpid(); + snl.nl_groups = 1; + + rv = bind(s, (struct sockaddr *) &snl, sizeof(snl)); + if (rv < 0) { + log_error("uevent bind error %d errno %d", rv, errno); + close(s); + return rv; + } + + return s; +} + /* recv "online" (join) and "offline" (leave) messages from dlm via uevents and pass them on to groupd */ @@ -298,7 +325,7 @@ static void process_uevent(int ci) struct lockspace *ls; char buf[MAXLINE]; char *argv[MAXARGS], *act, *sys; - int rv, argc = 0; + int rv, argc = 0, nobufs = 0; memset(buf, 0, sizeof(buf)); memset(argv, 0, sizeof(char *) * MAXARGS); @@ -306,10 +333,26 @@ static void process_uevent(int ci) retry_recv: rv = recv(client[ci].fd, &buf, sizeof(buf), 0); if (rv < 0) { + log_error("uevent recv error %d errno %d", rv, errno); if (errno == EINTR) goto retry_recv; - if (errno != EAGAIN) - log_error("uevent recv error %d errno %d", rv, errno); + if (errno == ENOBUFS && nobufs < MAX_UEVENT_NOBUFS) { + pollfd[ci].revents &= ~POLLERR; + nobufs++; + goto retry_recv; + } + if (errno != EAGAIN) { + close(client[ci].fd); + rv = setup_uevent(); + if (rv < 0) { + /* revent error will trigger cleanup by loop */ + return; + } + client[ci].fd = rv; + pollfd[ci].fd = rv; + pollfd[ci].revents = 0; + log_debug("uevent socket reconnected"); + } return; } @@ -374,32 +417,6 @@ static void process_uevent(int ci) act, rv, errno); } -static int setup_uevent(void) -{ - struct sockaddr_nl snl; - int s, rv; - - s = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); - if (s < 0) { - log_error("uevent netlink socket"); - return s; - } - - memset(&snl, 0, sizeof(snl)); - snl.nl_family = AF_NETLINK; - snl.nl_pid = getpid(); - snl.nl_groups = 1; - - rv = bind(s, (struct sockaddr *) &snl, sizeof(snl)); - if (rv < 0) { - log_error("uevent bind error %d errno %d", rv, errno); - close(s); - return rv; - } - - return s; -} - static void init_header(struct dlmc_header *h, int cmd, char *name, int result, int extra_len) {
1
0
0
0
Results per page:
10
25
50
100
200