From d73cdd7cb1110ac90381139364246e1de4b1725f Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Wed, 30 Nov 2011 19:23:52 +0100 Subject: [PATCH] Add torque-rhbz#758740-r5258-dis-close.patch and torque-rhbz#758740-r5270-dis-array.patch --- torque-rhbz#758740-r5258-dis-close.patch | 124 +++++++++++++++++++++++ torque-rhbz#758740-r5270-dis-array.patch | 27 +++++ torque.spec | 14 ++- 3 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 torque-rhbz#758740-r5258-dis-close.patch create mode 100644 torque-rhbz#758740-r5270-dis-array.patch diff --git a/torque-rhbz#758740-r5258-dis-close.patch b/torque-rhbz#758740-r5258-dis-close.patch new file mode 100644 index 0000000..6313088 --- /dev/null +++ b/torque-rhbz#758740-r5258-dis-close.patch @@ -0,0 +1,124 @@ ++ e - Added a new function DIS_tcp_close to the the code. This takes care of a problem ++ where TORQUE memory keeps growing because the read and write buffers associated ++ with each tcparray entry would grow to accommodate incoming and outgoing data ++ but would not shrink. + +Index: src/include/dis.h +=================================================================== +--- src/include/dis.h (revision 5257) ++++ src/include/dis.h (revision 5258) +@@ -238,13 +238,15 @@ + + /* the following routines set/control DIS over tcp */ + +-extern void DIS_tcp_reset (int fd, int rw); +-extern void DIS_tcp_setup (int fd); +-extern int DIS_tcp_wflush (int fd); +-extern void DIS_tcp_settimeout (long timeout); +-extern int DIS_tcp_istimeout (int fd); ++void DIS_tcp_reset (int fd, int rw); ++void DIS_tcp_setup (int fd); ++int DIS_tcp_wflush (int fd); ++void DIS_tcp_settimeout (long timeout); ++int DIS_tcp_istimeout (int fd); ++void DIS_tcp_close (int fd); + + ++ + extern int PConnTimeout(int); + + /* NOTE: increase THE_BUF_SIZE to 131072 for systems > 5k nodes */ +Index: src/lib/Libattr/attr_fn_arst.c +=================================================================== +--- src/lib/Libattr/attr_fn_arst.c (revision 5257) ++++ src/lib/Libattr/attr_fn_arst.c (revision 5258) +@@ -186,13 +186,14 @@ + + bksize = (ns - 1) * sizeof(char *) + sizeof(struct array_strings); + +- if ((stp = (struct array_strings *)malloc(bksize)) == NULL) ++ if (( patr->at_val.at_arst = (struct array_strings *)malloc(bksize)) == NULL) + { + /* FAILURE */ + + return(PBSE_SYSTEM); + } + ++ stp = patr->at_val.at_arst; + memset(stp, 0, bksize); + + stp->as_npointers = ns; +@@ -238,7 +239,7 @@ + + patr->at_flags |= ATR_VFLAG_SET | ATR_VFLAG_MODIFY; + +- patr->at_val.at_arst = stp; ++/* patr->at_val.at_arst = stp;*/ + + free(tmpval); + +Index: src/lib/Libifl/tcp_dis.c +=================================================================== +--- src/lib/Libifl/tcp_dis.c (revision 5257) ++++ src/lib/Libifl/tcp_dis.c (revision 5258) +@@ -790,9 +790,30 @@ + return; + } + ++void DIS_tcp_close( + ++ int fd) + ++ { ++ struct tcp_chan *tcp; + ++ tcp = tcparray[fd]; ++ if(tcp != NULL) ++ { ++ if(tcp->readbuf.tdis_thebuf != NULL) ++ free(tcp->readbuf.tdis_thebuf); ++ if(tcp->writebuf.tdis_thebuf != NULL) ++ free(tcp->writebuf.tdis_thebuf); ++ ++ free(tcp); ++ tcparray[fd] = NULL; ++ } ++ ++ return; ++ } ++ ++ ++ + /* + * DIS_tcp_setup - setup supports routines for dis, "data is strings", to + * use tcp stream I/O. Also initializes an array of pointers to +Index: src/lib/Libnet/net_server.c +=================================================================== +--- src/lib/Libnet/net_server.c (revision 5257) ++++ src/lib/Libnet/net_server.c (revision 5258) +@@ -114,6 +114,7 @@ + #include "server_limits.h" + #include "net_connect.h" + #include "log.h" ++#include "dis.h" /* DIS_tcp_close */ + + extern int LOGLEVEL; + +@@ -718,6 +719,7 @@ + int sd) /* I */ + + { ++ + if ((sd < 0) || (max_connection <= sd)) + { + return; +@@ -757,6 +759,9 @@ + + num_connections--; + ++ DIS_tcp_close(sd); ++ ++ + return; + } /* END close_conn() */ + diff --git a/torque-rhbz#758740-r5270-dis-array.patch b/torque-rhbz#758740-r5270-dis-array.patch new file mode 100644 index 0000000..b70ab5f --- /dev/null +++ b/torque-rhbz#758740-r5270-dis-array.patch @@ -0,0 +1,27 @@ +Index: src/lib/Libifl/tcp_dis.c +=================================================================== +--- src/lib/Libifl/tcp_dis.c (revision 5269) ++++ src/lib/Libifl/tcp_dis.c (revision 5270) +@@ -797,12 +797,19 @@ + { + struct tcp_chan *tcp; + ++ /* On startup tcparray may not yet be initialized. check it */ ++ if (tcparray == NULL) ++ return; ++ ++ if (fd > tcparraymax) ++ return; ++ + tcp = tcparray[fd]; +- if(tcp != NULL) ++ if (tcp != NULL) + { +- if(tcp->readbuf.tdis_thebuf != NULL) ++ if (tcp->readbuf.tdis_thebuf != NULL) + free(tcp->readbuf.tdis_thebuf); +- if(tcp->writebuf.tdis_thebuf != NULL) ++ if (tcp->writebuf.tdis_thebuf != NULL) + free(tcp->writebuf.tdis_thebuf); + + free(tcp); diff --git a/torque.spec b/torque.spec index 17d8993..f7b7685 100644 --- a/torque.spec +++ b/torque.spec @@ -3,7 +3,7 @@ %define name torque %define version 2.5.7 #%%define snap 200604251602 -%define release 5 +%define release 6 # The following options are supported: # --with server_name=hostname @@ -103,6 +103,11 @@ Patch2: torque-initd-hangs-rhbz-744138.patch Patch3: torque-fix-munge-rhbz#752079.patch Patch4: torque-fix-munge-rhbz#752079-PTII.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=758740 +Patch5: torque-rhbz#758740-r5258-dis-close.patch +Patch6: torque-rhbz#758740-r5270-dis-array.patch + + License: OpenPBS and TORQUEv1.1 Group: System Environment/Daemons URL: http://www.clusterresources.com/products/torque/ @@ -140,6 +145,9 @@ pushd src/server %patch4 -p 0 popd +%patch5 -p0 +%patch6 -p0 + %__install -pm 644 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} . @@ -494,6 +502,10 @@ A simple PAM module to authorize users on PBS MOM nodes with a running job. %changelog +* Mon Nov 21 2011 Steve Traylen - 2.5.7-6 +- Add torque-rhbz#758740-r5258-dis-close.patch and + torque-rhbz#758740-r5270-dis-array.patch + * Mon Nov 21 2011 Steve Traylen - 2.5.7-5 - Add torque-fix-munge-rhbz#752079-PTII.patch