code: func (m *manager) syncBatch() {
  	var updatedStatuses []podStatusSyncRequest
  	podToMirror, mirrorToPod := m.podManager.GetUIDTranslations()
  	func() { // Critical section
  		m.podStatusesLock.RLock()
  		defer m.podStatusesLock.RUnlock()
  
  		// Clean up orphaned versions.
  		for uid := range m.apiStatusVersions {
  			_, hasPod := m.podStatuses[types.UID(uid)]
  			_, hasMirror := mirrorToPod[uid]
  			if !hasPod && !hasMirror {
  				delete(m.apiStatusVersions, uid)
  			}
  		}
  
  		for uid, status := range m.podStatuses {
  			syncedUID := kubetypes.MirrorPodUID(uid)
  			if mirrorUID, ok := podToMirror[kubetypes.ResolvedPodUID(uid)]; ok {
  				if mirrorUID == "" {
  					klog.V(5).Infof("Static pod %q (%s/%s) does not have a corresponding mirror pod; skipping", uid, status.podName, status.podNamespace)
  					continue
  				}
  				syncedUID = mirrorUID
  			}
  			if m.needsUpdate(types.UID(syncedUID), status) {
  				updatedStatuses = append(updatedStatuses, podStatusSyncRequest{uid, status})
  			} else if m.needsReconcile(uid, status.status) {
  				// Delete the apiStatusVersions here to force an update on the pod status
  				// In most cases the deleted apiStatusVersions here should be filled
  				// soon after the following syncPod() [If the syncPod() sync an update
  				// successfully].
  				delete(m.apiStatusVersions, syncedUID)
  				updatedStatuses = append(updatedStatuses, podStatusSyncRequest{uid, status})
  			}
  		}
  	}()
  
  	for _, update := range updatedStatuses {
  		klog.V(5).Infof("Status Manager: syncPod in syncbatch. pod UID: %q", update.podUID)
  		m.syncPod(update.podUID, update.status)
  	}
  }
docs: // syncBatch syncs pods statuses with the apiserver.