Skip to content

Commit 7f3eda5

Browse files
Enhance MCAD Logs and fix naming consistency + typos
1 parent 8c4c3f0 commit 7f3eda5

File tree

6 files changed

+90
-90
lines changed

6 files changed

+90
-90
lines changed

pkg/controller/queuejob/queuejob_controller_ex.go

Lines changed: 76 additions & 76 deletions
Large diffs are not rendered by default.

pkg/controller/queuejob/scheduling_queue.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (p *PriorityQueue) MoveToActiveQueueIfExists(aw *qjobv1.AppWrapper) error {
161161
p.unschedulableQ.Delete(aw)
162162
err := p.activeQ.AddIfNotPresent(aw)
163163
if err != nil {
164-
klog.Errorf("[MoveToActiveQueueIfExists] Error adding AW %v to the scheduling queue: %v\n", aw.Name, err)
164+
klog.Errorf("[MoveToActiveQueueIfExists] Error adding AW %s/%s to the scheduling queue: %v\n", aw.Namespace, aw.Name, err)
165165
}
166166
p.cond.Broadcast()
167167
return err
@@ -176,10 +176,10 @@ func (p *PriorityQueue) Add(qj *qjobv1.AppWrapper) error {
176176
defer p.lock.Unlock()
177177
err := p.activeQ.Add(qj)
178178
if err != nil {
179-
klog.Errorf("Error adding QJ %v to the scheduling queue: %v", qj.Name, err)
179+
klog.Errorf("Error adding QJ %s/%s to the scheduling queue: %v", qj.Namespace, qj.Name, err)
180180
} else {
181181
if p.unschedulableQ.Get(qj) != nil {
182-
klog.Errorf("Error: QJ %v is already in the unschedulable queue.", qj.Name)
182+
klog.Errorf("Error: QJ %s/%s is already in the unschedulable queue.", qj.Namespace, qj.Name)
183183
p.unschedulableQ.Delete(qj)
184184
}
185185
p.cond.Broadcast()
@@ -201,7 +201,7 @@ func (p *PriorityQueue) AddIfNotPresent(qj *qjobv1.AppWrapper) error {
201201
}
202202
err := p.activeQ.Add(qj)
203203
if err != nil {
204-
klog.Errorf("Error adding pod %v to the scheduling queue: %v", qj.Name, err)
204+
klog.Errorf("Error adding pod %s/%s to the scheduling queue: %v", qj.Namespace, qj.Name, err)
205205
} else {
206206
p.cond.Broadcast()
207207
}

pkg/controller/queuejobdispatch/queuejobagent.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (cc *JobClusterAgent) addQueueJob(obj interface{}) {
129129
klog.Errorf("obj is not AppWrapper")
130130
return
131131
}
132-
klog.V(10).Infof("[TTime]: %s Adding New Job: %s to EventQ\n", time.Now().String(), qj.Name)
132+
klog.V(10).Infof("[TTime]: %s Adding New Job: %s/%s to EventQ\n", time.Now().String(), qj.Namespace, qj.Name)
133133
cc.agentEventQueue.Add(qj)
134134
}
135135

@@ -139,7 +139,7 @@ func (cc *JobClusterAgent) updateQueueJob(oldObj, newObj interface{}) {
139139
klog.Errorf("newObj is not AppWrapper")
140140
return
141141
}
142-
klog.V(10).Infof("[TTime]: %s Adding Update Job: %s to EventQ\n", time.Now().String(), newQJ.Name)
142+
klog.V(10).Infof("[TTime]: %s Adding Update Job: %s/%s to EventQ\n", time.Now().String(), newQJ.Namespace, newQJ.Name)
143143
cc.agentEventQueue.Add(newQJ)
144144
}
145145

@@ -149,7 +149,7 @@ func (cc *JobClusterAgent) deleteQueueJob(obj interface{}) {
149149
klog.Errorf("obj is not AppWrapper")
150150
return
151151
}
152-
klog.V(10).Infof("[TTime]: %s Adding Delete Job: %s to EventQ\n", time.Now().String(), qj.Name)
152+
klog.V(10).Infof("[TTime]: %s Adding Delete Job: %s/%s to EventQ\n", time.Now().String(), qj.Namespace, qj.Name)
153153
cc.agentEventQueue.Add(qj)
154154
}
155155

@@ -160,7 +160,7 @@ func (qa *JobClusterAgent) Run(stopCh <-chan struct{}) {
160160

161161
func (qa *JobClusterAgent) DeleteJob(ctx context.Context, cqj *arbv1.AppWrapper) {
162162
qj_temp := cqj.DeepCopy()
163-
klog.V(2).Infof("[Dispatcher: Agent] Request deletion of XQJ %s to Agent %s\n", qj_temp.Name, qa.AgentId)
163+
klog.V(2).Infof("[Dispatcher: Agent] Request deletion of XQJ %s/%s to Agent %s\n", qj_temp.Namespace, qj_temp.Name, qa.AgentId)
164164
qa.queuejobclients.WorkloadV1beta1().AppWrappers(qj_temp.Namespace).Delete(ctx, qj_temp.Name, metav1.DeleteOptions{})
165165
}
166166

@@ -182,7 +182,7 @@ func (qa *JobClusterAgent) CreateJob(ctx context.Context, cqj *arbv1.AppWrapper)
182182
}
183183
agent_qj.Labels["IsDispatched"] = "true"
184184

185-
klog.V(2).Infof("[Dispatcher: Agent] Create XQJ: %s (Status: %+v) in Agent %s\n", agent_qj.Name, agent_qj.Status, qa.AgentId)
185+
klog.V(2).Infof("[Dispatcher: Agent] Create XQJ: %s/%s (Status: %+v) in Agent %s\n", agent_qj.Namespace, agent_qj.Name, agent_qj.Status, qa.AgentId)
186186
qa.queuejobclients.WorkloadV1beta1().AppWrappers(agent_qj.Namespace).Create(ctx, agent_qj, metav1.CreateOptions{})
187187
}
188188

pkg/controller/queuejobresources/genericresource/genericresource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (gr *GenericResources) SyncQueueJob(aw *arbv1.AppWrapper, awr *arbv1.AppWra
199199
if pErr := recover(); pErr != nil {
200200
klog.Errorf("[SyncQueueJob] Panic occurred: %v, stacktrace: %s", pErr, string(debug.Stack()))
201201
}
202-
klog.V(4).Infof("Finished syncing AppWrapper job resource %s (%v)", aw.Name, time.Now().Sub(startTime))
202+
klog.V(4).Infof("Finished syncing AppWrapper job resource %s/%s (%v)", aw.Namespace, aw.Name, time.Now().Sub(startTime))
203203
}()
204204

205205
namespaced := true

pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ func (qm *QuotaManager) Release(aw *arbv1.AppWrapper) bool {
641641
// Handle uninitialized quota manager
642642
if qm.quotaManagerBackend == nil {
643643
klog.Errorf("[Release] No quota manager backend exists, Quota release %s/%s fails quota by default.",
644-
aw.Name, aw.Namespace)
644+
aw.Namespace, aw.Name)
645645
return false
646646
}
647647

pkg/controller/quota/quotaforestmanager/qm_lib_backend_with_quotasubt_mgr/quotasubtmgr/event_handlers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (qstm *QuotaSubtreeManager) addQST(obj interface{}) {
3333
qstm.qstMap[qst.Namespace+"/"+qst.Name] = qst
3434
qstm.setQuotasubtreeChanged()
3535
qstm.qstMutex.Unlock()
36-
klog.V(4).Infof("[addQST] Add complete for: %s/%s", qst.Name, qst.Namespace)
36+
klog.V(4).Infof("[addQST] Add complete for: %s/%s", qst.Namespace, qst.Name)
3737
}
3838

3939
func (qstm *QuotaSubtreeManager) updateQST(oldObj, newObj interface{}) {
@@ -65,7 +65,7 @@ func (qstm *QuotaSubtreeManager) updateQST(oldObj, newObj interface{}) {
6565
qstm.setQuotasubtreeChanged()
6666
qstm.qstMutex.Unlock()
6767
}
68-
klog.V(4).Infof("[updateQST] Update complete for: %s/%s", newQST.Name, newQST.Namespace)
68+
klog.V(4).Infof("[updateQST] Update complete for: %s/%s", newQST.Namespace, newQST.Name)
6969
}
7070

7171
func (qstm *QuotaSubtreeManager) deleteQST(obj interface{}) {
@@ -79,5 +79,5 @@ func (qstm *QuotaSubtreeManager) deleteQST(obj interface{}) {
7979

8080
delete(qstm.qstMap, string(qst.UID))
8181
delete(qstm.qstMap, qst.Namespace+"/"+qst.Name)
82-
klog.V(4).Infof("[deleteQST] Delete complete for: %s/%s", qst.Name, qst.Namespace)
82+
klog.V(4).Infof("[deleteQST] Delete complete for: %s/%s", qst.Namespace, qst.Name)
8383
}

0 commit comments

Comments
 (0)