@@ -115,10 +115,6 @@ func GetDispatchWaitGroup(ctx context.Context) *sync.WaitGroup {
115115	return  ctx .Value (contextDispatchWaitGroup ).(* sync.WaitGroup )
116116}
117117
118- func  IsCancelled (ctx  context.Context ) bool  {
119- 	return  context .Cause (ctx ) !=  nil 
120- }
121- 
122118// Start starts the dispatch 
123119func  (d  * Dispatch ) Start () error  {
124120	ifac  :=  informers .NewSharedInformerFactoryWithOptions (d .Kubernetes , podInformerResyncInterval , informers .WithNamespace (d .KubernetesNamespace ))
@@ -195,8 +191,8 @@ func (d *Dispatch) DisposeWorkspace(ctx context.Context, instanceID string) {
195191	d .mu .Lock ()
196192	defer  d .mu .Unlock ()
197193
198- 	log .WithField ("instanceID" , instanceID ).Debug ("WS DISPOSE " )
199- 	defer  log .WithField ("instanceID" , instanceID ).Debug ("WS DISPOSE DONE " )
194+ 	log .WithField ("instanceID" , instanceID ).Debug ("disposing workspace " )
195+ 	defer  log .WithField ("instanceID" , instanceID ).Debug ("disposing workspace done " )
200196
201197	// If we have that instanceID present, cancel it's context 
202198	state , present  :=  d .ctxs [instanceID ]
@@ -237,10 +233,9 @@ func (d *Dispatch) handlePodUpdate(oldPod, newPod *corev1.Pod) {
237233	}
238234	disposedKey  :=  disposedKey (workspaceInstanceID , newPod )
239235	if  _ , alreadyDisposed  :=  d .disposedCtxs [disposedKey ]; alreadyDisposed  {
240- 		log .WithField ("disposedKey" , disposedKey ).Debug ("DROPPING POD UPDATE FOR DISPOSED POD " )
236+ 		log .WithField ("disposedKey" , disposedKey ).Debug ("dropping pod update for disposed pod " )
241237		return 
242238	}
243- 	log .WithField ("instanceID" , workspaceInstanceID ).Debugf ("POD UPDATE: %s" , workspaceInstanceID )
244239
245240	d .mu .Lock ()
246241	defer  d .mu .Unlock ()
@@ -337,15 +332,15 @@ func (d *Dispatch) handlePodUpdate(oldPod, newPod *corev1.Pod) {
337332			}
338333		}()
339334	}
340- 	log .WithField ("instanceID" , workspaceInstanceID ).Debugf ("POD UPDATE DONE: %s" , workspaceInstanceID )
341335}
342336
343337func  (d  * Dispatch ) handlePodDeleted (pod  * corev1.Pod ) {
344338	instanceID , ok  :=  pod .Labels [wsk8s .WorkspaceIDLabel ]
345339	if  ! ok  {
346340		return 
347341	}
348- 	log .WithField ("instanceID" , instanceID ).Debugf ("POD DELETED: %s" , instanceID )
342+ 	log .WithField ("instanceID" , instanceID ).Debug ("pod deleted" )
343+ 	defer  log .WithField ("instanceID" , instanceID ).Debug ("pod deleted done" )
349344
350345	d .mu .Lock ()
351346	defer  d .mu .Unlock ()
@@ -361,5 +356,4 @@ func (d *Dispatch) handlePodDeleted(pod *corev1.Pod) {
361356
362357	delete (d .ctxs , instanceID )
363358
364- 	log .WithField ("instanceID" , instanceID ).Debugf ("POD DELETED DONE: %s" , instanceID )
365359}
0 commit comments