Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' 4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' 4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' 4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' 4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' 4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); 4.2.0 by braddaw · Pull Request #38 · adaptivecomputing/torque · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ c - crash b - bug fix e - enhancement f - new feature n - note

4.1.5
b - For cray: make sure that reservations are released when jobs are requeued. TRQ-1572.
c - If the job is no long valid after attempting to lock the array in get_jobs_array(),
make sure the array is valid before attempting to unlock it. TRQ-1598.

4.1.4
e - When in cray mode, write physmem and availmem in addition to totmem so that
Expand Down
4 changes: 2 additions & 2 deletions src/pam/pam_pbssimpleauth.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
#include "portability.h"
#include "list_link.h"
#include "pbs_ifl.h"
#include "lib_ifl.h"
#include "attribute.h"
#include "server_limits.h"
#include "pbs_job.h"
Expand DownExpand Up@@ -54,7 +55,6 @@
#endif



/* --- authentication management functions (only) --- */

PAM_EXTERN
Expand DownExpand Up@@ -104,7 +104,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc,
}

/* get the username and passwd, allow uid 0 */
retval = pam_get_user(pamh, &username, NULL);
retval = pam_get_user(pamh, (const char **)&username, NULL);

#if defined(PAM_CONV_AGAIN) && defined(PAM_INCOMPLETE)
if (retval == PAM_CONV_AGAIN)
Expand Down
2 changes: 1 addition & 1 deletion src/resmom/start_exec.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -4147,7 +4147,7 @@ int TMomFinalizeChild(
/* Put the script's arguments on the command line (see configure option --enable-shell-use-argv). */
if (TJE->is_interactive == FALSE)
{
arg[aindex] = calloc(1,
arg[aindex] = (char *)calloc(1,
strlen(path_jobs) +
strlen(pjob->ji_qs.ji_fileprefix) +
strlen(JOB_SCRIPT_SUFFIX) + 6);
Expand Down
4 changes: 3 additions & 1 deletion src/server/display_alps_status.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,8 @@
#include "list_link.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;


int status_node(struct pbsnode *, struct batch_request *, int *, tlist_head *);

Expand All@@ -24,7 +26,7 @@ int get_alps_statuses(
while ((alps_node = next_host(&(parent->alps_subnodes), &iter, NULL)) != NULL)
{
rc = status_node(alps_node, preq, bad, pstathd);
unlock_node(alps_node, __func__, NULL, 0);
unlock_node(alps_node, __func__, NULL, LOGLEVEL);

if (rc != PBSE_NONE)
break;
Expand Down
1 change: 1 addition & 0 deletions src/server/exiting_jobs.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -214,6 +214,7 @@ int check_exiting_jobs()
}
else
{
pjob_mutex.unlock();
retry_job_exit(jeri);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/server/job_container.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,18 +478,18 @@ job *svr_find_job(
{
pj = pj->ji_external_clone;

lock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, 0);
lock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
unlock_ji_mutex(pj->ji_parent_job, __func__, NULL, LOGLEVEL);

if (pj->ji_being_recycled == TRUE)
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
else
{
unlock_ji_mutex(pj, __func__, NULL, 0);
unlock_ji_mutex(pj, __func__, NULL, LOGLEVEL);
pj = NULL;
}
}
Expand Down
19 changes: 11 additions & 8 deletions src/server/job_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -741,13 +741,13 @@ void job_free(

if (pj->ji_cray_clone != NULL)
{
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_cray_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_cray_clone, TRUE);
}

if (pj->ji_external_clone != NULL)
{
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, 0);
lock_ji_mutex(pj->ji_external_clone, __func__, NULL, LOGLEVEL);
job_free(pj->ji_external_clone, TRUE);
}

Expand DownExpand Up@@ -2056,12 +2056,15 @@ job_array *get_jobs_array(
pjob = svr_find_job(jobid, TRUE);
if (pjob == NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
if (pa != NULL)
{
unlock_ai_mutex(pa, __func__, "1", LOGLEVEL);
pa = NULL;
}

*pjob_ptr = NULL;
}
mutex_mgr job_mutex2(pjob->ji_mutex,true);
job_mutex2.set_lock_on_exit(false);

}

return(pa);
Expand DownExpand Up@@ -2299,7 +2302,7 @@ int split_job(
change_external_job_name(external);
external->ji_parent_job = pjob;
pjob->ji_external_clone = external;
unlock_ji_mutex(external, __func__, NULL, 0);
unlock_ji_mutex(external, __func__, NULL, LOGLEVEL);
}

if (pjob->ji_cray_clone == NULL)
Expand All@@ -2308,7 +2311,7 @@ int split_job(
fix_cray_exec_hosts(cray);
cray->ji_parent_job = pjob;
pjob->ji_cray_clone = cray;
unlock_ji_mutex(cray, __func__, NULL, 0);
unlock_ji_mutex(cray, __func__, NULL, LOGLEVEL);
}

return(PBSE_NONE);
Expand Down
22 changes: 16 additions & 6 deletions src/server/job_route.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -337,19 +337,29 @@ int job_route(
time_t time_now = time(NULL);
char log_buf[LOCAL_LOG_BUF_SIZE];

struct pbs_queue *qp = jobp->ji_qhdr;
struct pbs_queue *qp;
long retry_time;

if (qp == NULL)
return(PBSE_QUENOEN);

if (LOGLEVEL >= 7)
{
sprintf(log_buf, "%s", jobp->ji_qs.ji_jobid);
LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
log_event(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, __func__, log_buf);
}

qp = get_jobs_queue(&jobp);

if (jobp == NULL)
{
return(PBSE_JOB_RECYCLED);
}

if (qp == NULL)
{
return(PBSE_BADSTATE);
}

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex, true);

mutex_mgr qp_mutex = mutex_mgr(qp->qu_mutex);
/* see if the job is able to be routed */
switch (jobp->ji_qs.ji_state)
{
Expand Down
9 changes: 5 additions & 4 deletions src/server/login_nodes.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -84,6 +84,7 @@
#include "login_nodes.h"
#include "../lib/Libutils/u_lock_ctl.h"

extern int LOGLEVEL;

login_holder logins;

Expand DownExpand Up@@ -132,7 +133,7 @@ struct pbsnode *check_node(
{
struct pbsnode *pnode = ln->pnode;

lock_node(pnode, __func__, NULL, 20);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if ((hasprop(pnode, needed) == TRUE) &&
(pnode->nd_nsn - pnode->nd_np_to_be_used >= 1) &&
Expand All@@ -141,7 +142,7 @@ struct pbsnode *check_node(
return(pnode);
else
{
unlock_node(pnode, __func__, NULL, 20);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
return(NULL);
}
} /* END check_node() */
Expand DownExpand Up@@ -252,7 +253,7 @@ struct pbsnode *get_next_login_node(
if (ln != NULL)
{
pnode = ln->pnode;
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);

if (needed != NULL)
{
Expand All@@ -272,7 +273,7 @@ struct pbsnode *get_next_login_node(

if (node_fits == FALSE)
{
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);
pnode = find_fitting_node(needed);
}
else
Expand Down
24 changes: 12 additions & 12 deletions src/server/node_func.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -285,7 +285,7 @@ struct pbsnode *find_node_in_allnodes(
pnode = (struct pbsnode *)an->ra->slots[index].item;

if (pnode != NULL)
lock_node(pnode, __func__, 0, 0);
lock_node(pnode, __func__, 0, LOGLEVEL);
}

pthread_mutex_unlock(an->allnodes_mutex);
Expand DownExpand Up@@ -351,17 +351,17 @@ struct pbsnode *find_nodebyname(
{
if (alps_reporter != NULL)
{
lock_node(alps_reporter, __func__, NULL, 0);
lock_node(alps_reporter, __func__, NULL, LOGLEVEL);

if ((i = get_value_hash(alps_reporter->alps_subnodes.ht, (void *)nodename)) >= 0)
{
if ((pnode = (struct pbsnode *)alps_reporter->alps_subnodes.ra->slots[i].item) != NULL)
{
lock_node(pnode, __func__, NULL, 0);
lock_node(pnode, __func__, NULL, LOGLEVEL);
}
}

unlock_node(alps_reporter, __func__, NULL, 0);
unlock_node(alps_reporter, __func__, NULL, LOGLEVEL);
}
}
else
Expand DownExpand Up@@ -2427,15 +2427,15 @@ int setup_nodes(void)
np->nd_is_alps_reporter = TRUE;
alps_reporter = np;
initialize_all_nodes_array(&(np->alps_subnodes));
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
else if (is_alps_starter == TRUE)
{
np = find_nodebyname(nodename);
np->nd_is_alps_login = TRUE;
add_to_login_holder(np);
/* NYI: add to login node list */
unlock_node(np, __func__, NULL, 0);
unlock_node(np, __func__, NULL, LOGLEVEL);
}
}

Expand DownExpand Up@@ -3248,7 +3248,7 @@ static struct pbsnode *get_my_next_alps_node(
{
struct pbsnode *alps_node = next_host(&(pnode->alps_subnodes), &(iter->alps_index), NULL);

unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

return(alps_node);
} /* END get_my_next_alps_node() */
Expand DownExpand Up@@ -3340,7 +3340,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand All@@ -3349,7 +3349,7 @@ struct pbsnode *next_node(
}
else
{
unlock_node(current, __func__, NULL, 0);
unlock_node(current, __func__, NULL, LOGLEVEL);
iter->alps_index = -1;

pthread_mutex_lock(an->allnodes_mutex);
Expand All@@ -3358,7 +3358,7 @@ struct pbsnode *next_node(

if (next != NULL)
{
lock_node(next, __func__, NULL, 0);
lock_node(next, __func__, NULL, LOGLEVEL);

if (next->nd_is_alps_reporter)
next = get_my_next_alps_node(iter, next);
Expand DownExpand Up@@ -3542,7 +3542,7 @@ struct pbsnode *next_host(
if (held != NULL)
{
name = strdup(held->nd_name);
unlock_node(held, __func__, NULL, 0);
unlock_node(held, __func__, NULL, LOGLEVEL);
}
pthread_mutex_lock(an->allnodes_mutex);
}
Expand DownExpand Up@@ -3595,7 +3595,7 @@ void *send_hierarchy_threadtask(
if (pnode != NULL)
{
port = pnode->nd_mom_rm_port;
unlock_node(pnode, __func__, NULL, 0);
unlock_node(pnode, __func__, NULL, LOGLEVEL);

if (send_hierarchy(hi->name, port) != PBSE_NONE)
{
Expand Down
Loading