feat: add debug logs

This commit is contained in:
Mohamad Khani 2025-02-18 23:08:19 +03:30
parent 1ff69e086f
commit 55dbe9f8c2
4 changed files with 14 additions and 12 deletions

View File

@ -17,10 +17,9 @@ func (crd Crd) manageFinalizer(jobEventObservable rxgo.Observable) {
finalizerName := "flink-operator.logicamp.tech/finalizer"
for j := range jobEventObservable.Observe() {
go func() {
jobEvent := j.V.(*FlinkJobCrdEvent)
pkg.Logger.Debug("[crd] [manage-finalizer] main loop", zap.String("name", jobEvent.Job.Name))
go func() {
if jobEvent.Job.GetDeletionTimestamp() != nil {
// Resource is being deleted
if controllerutil.ContainsFinalizer(jobEvent.Job, finalizerName) {

View File

@ -41,12 +41,14 @@ func (crd Crd) watchFlinkJobs() rxgo.Observable {
continue
}
go func() {
ch <- rxgo.Item{
V: &FlinkJobCrdEvent{
EventType: event.Type,
Job: job,
},
}
}()
pkg.Logger.Debug("[crd] [watch] change in", zap.String("name", job.Name))
switch event.Type {
case watch.Bookmark:

View File

@ -51,5 +51,5 @@ func (job *ManagedJob) Cycle() {
// return
// }
pkg.Logger.Warn("[managed-job] [cycle]", zap.String("unhanded job status", string(job.def.Status.JobStatus)))
pkg.Logger.Warn("[managed-job] [cycle] unhanded job status", zap.String("name", job.def.Name), zap.String("status", string(job.def.Status.JobStatus)))
}

View File

@ -71,11 +71,10 @@ func (mgr *Manager) cycle(client *api.Client, crdInstance *crd.Crd) {
},
})
}
//pkg.Logger.Debug("[manager] [cycle] overviews", zap.Any("overviews", jobsOverviews))
pkg.Logger.Debug("[manager] [cycle] overviews", zap.Any("overviews", jobManagerJobOverviews))
// Loop over job definitions as Kubernetes CRD
for _, uid := range crd.GetAllJobKeys() {
// pkg.Logger.Debug("mgr.processingJobsIds", zap.Any("processingJobIds", mgr.processingJobsIds))
if lo.Contains(mgr.processingJobsIds, uid) {
pkg.Logger.Warn("[manager] already in process", zap.Any("uid", uid))
continue
@ -97,6 +96,8 @@ func (mgr *Manager) cycle(client *api.Client, crdInstance *crd.Crd) {
}
pkg.Logger.Debug("[manager] [cycle] finding job", zap.Any("name", managedJob.def.Name))
jobManagerJobOverview, jobFound := lo.Find(jobManagerJobOverviews.Jobs, func(job api.JobOverview) bool {
jobId := managedJob.GetJobId()
if jobId != nil {