Rush has submitted this change and it was merged.

Change subject: www: guard against missing 
$xjob->JB_hard_resource_list->qstat_l_requests
......................................................................


www: guard against missing $xjob->JB_hard_resource_list->qstat_l_requests

Seen in logs:
2016-11-21 00:06:25: (mod_fastcgi.c.2673) FastCGI-stderr: PHP Warning:
Invalid argument supplied for foreach() in
/mnt/nfs/labstore-secondary-tools-project/admin/toollabs/www/content/status.php
on line 60
2016-11-21 00:06:25: (mod_fastcgi.c.2673) FastCGI-stderr: PHP Stack
trace: 2016-11-21 00:06:25: (mod_fastcgi.c.2673) FastCGI-stderr: PHP
1. {main}()
/mnt/nfs/labstore-secondary-tools-project/admin/toollabs/www/index.php:0
2016-11-21 00:06:25: (mod_fastcgi.c.2673) FastCGI-stderr: PHP   2.
include()
/mnt/nfs/labstore-secondary-tools-project/admin/toollabs/www/index.php:135

Change-Id: I939b4baab1b68403a7ac91026036ce4a3a5adf01
---
M www/content/status.php
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Rush: Verified; Looks good to me, approved



diff --git a/www/content/status.php b/www/content/status.php
index b31a503..a381842 100644
--- a/www/content/status.php
+++ b/www/content/status.php
@@ -57,9 +57,13 @@
        } else {
                $job['queue'] = '(manual)';
        }
-       foreach ( $xjob->JB_hard_resource_list->qstat_l_requests as $lreq ) {
-               if ( $lreq->CE_name === 'h_vmem' ) {
-                       $job['h_vmem'] = (int) $lreq->CE_doubleval;
+       if ( $xjob->JB_hard_resource_list &&
+               $xjob->JB_hard_resource_list->qstat_l_requests
+       ) {
+               foreach ( $xjob->JB_hard_resource_list->qstat_l_requests as 
$lreq ) {
+                       if ( $lreq->CE_name === 'h_vmem' ) {
+                               $job['h_vmem'] = (int) $lreq->CE_doubleval;
+                       }
                }
        }
        if ( $xjob->JB_ja_tasks->jatask &&

-- 
To view, visit https://gerrit.wikimedia.org/r/322605
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I939b4baab1b68403a7ac91026036ce4a3a5adf01
Gerrit-PatchSet: 3
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Coren <[email protected]>
Gerrit-Reviewer: Madhuvishy <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to