Project

General

Profile

Revision 7c52294b

ID7c52294be69e6c20f51a09e736834166ecec7598
Parent 934f2f0e
Child 93cdd7be, b5577fd2, cbf34809, 651d6dc5

Added by John Spray about 10 years ago

cthulhu: Handle UserRequests waiting for already-present maps

Fixes: #7383

View differences:

cthulhu/cthulhu/manager/request_collection.py
205 205
                                log.debug("Notifying SyncObjects of awaited version %s/%s" % (sync_type.str, version))
206 206
                                self._sync_objects.on_version(data['id'], sync_type, version)
207 207

  
208
                            # The request may be waiting for an epoch that we already have, if so
209
                            # give it to the request right away
210
                            for sync_type, want_version in request.awaiting_versions.items():
211
                                got_version = self._sync_objects.get_version(sync_type)
212
                                if sync_type.cmp(got_version, want_version) >= 0:
213
                                    log.info("Awaited %s %s is immediately available" % (sync_type, want_version))
214
                                    with self._update_index(request):
215
                                        request.on_map(sync_type, self._sync_objects)
216

  
208 217
                except Exception as e:
209 218
                    # Ensure that a misbehaving piece of code in a UserRequest subclass
210 219
                    # results in a terminated job, not a zombie job

Also available in: Unified diff