Bug 184 - pbs_server fails after you've added 12 job arrays
: pbs_server fails after you've added 12 job arrays
Status: RESOLVED FIXED
Product: TORQUE
pbs_server
: 3.0.x
: PC Linux
: P5 critical
Assigned To: David Beer
:
:
:
  Show dependency treegraph
 
Reported: 2012-04-24 00:21 MDT by rhys.hill
Modified: 2012-05-03 14:03 MDT (History)
2 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description rhys.hill 2012-04-24 00:21:27 MDT
There's a documentation and then code bug which means that if you add 12 job
arrays to pbs_server, it prints out this message:

04/24/2012 15:41:23;0001;PBS_Server;Svr;PBS_Server;LOG_ERROR::Cannot allocate
memory (12) in insert_array, No memory to resize the array...SYSTEM FAILURE

After this, job arrays are broken until pbs_server is restarted, then you get
phantom job arrays left in the queue. This fixes it (Note that ENOMEM==12):

Index: src/lib/Libutils/u_resizable_array.c
===================================================================
--- src/lib/Libutils/u_resizable_array.c    (revision 6023)
+++ src/lib/Libutils/u_resizable_array.c    (working copy)
@@ -186,7 +186,8 @@
 /*
  * inserts an item, resizing the array if necessary
  *
- * @return the index in the array or ENOMEM
+ * @return the index in the array or -1 on failure,
+ * which indicates ENOMEM.
  */
 int insert_thing(

Index: src/server/array_func.c
===================================================================
--- src/server/array_func.c    (revision 6023)
+++ src/server/array_func.c    (working copy)
@@ -1879,7 +1879,7 @@

   pthread_mutex_lock(allarrays.allarrays_mutex);

-  if ((rc = insert_thing(allarrays.ra,pa)) == ENOMEM)
+  if ((rc = insert_thing(allarrays.ra,pa)) == -1)
     {
     log_err(rc,id,"No memory to resize the array...SYSTEM FAILURE\n");
     }
Comment 1 David Beer 2012-05-03 13:09:56 MDT
This fix will be in 4.0.2. Please note that there is not actually incorrect
behavior here - it's just a bad log message.
Comment 2 David Beer 2012-05-03 14:03:40 MDT
Committed to 4.0.2