rill icon indicating copy to clipboard operation
rill copied to clipboard

Race condition with creating and quickly deleting a model (while profiling is still happening)

Open bcolloran opened this issue 3 years ago • 0 comments

Describe the bug Deleting a model that is being profiled cause the backend to crash and the UI to hang. Terminal running the backed shows the following:

TypeError: Cannot read properties of undefined (reading 'profile')
    at ProfileColumnStateActions.updateColumnSummary (/src/common/data-modeler-state-service/ProfileColumnStateActions.ts:43:44)
    at /src/common/data-modeler-state-service/DataModelerStateService.ts:177:33
    at /src/common/data-modeler-state-service/BatchedStateUpdate.ts:91:41
    at Array.forEach (<anonymous>)
    at /src/common/data-modeler-state-service/BatchedStateUpdate.ts:91:19
    at recipe (/src/common/data-modeler-state-service/entity-state-service/EntityStateService.ts:96:11)
    at Immer.produce (/node_modules/immer/src/core/immerClass.ts:94:14)
    at DerivedModelEntityService.updateState (/src/common/data-modeler-state-service/entity-state-service/EntityStateService.ts:93:14)
    at BatchedStateUpdate.batchUpdateState (/src/common/data-modeler-state-service/BatchedStateUpdate.ts:89:13)
    at /src/common/data-modeler-state-service/BatchedStateUpdate.ts:53:18
[ERROR] 13:37:51 TypeError: Cannot read properties of undefined (reading 'profile')

To Reproduce Steps to reproduce the behavior:

  • create a new model (note: I bet this would probably work with an existing model, though I have not tested that)
  • start a query on a large enough dataset that it takes a while for profiling results to return e.g. select * from nyc311_reduced
  • as soon as you can (the UI will hang/is non-responsive for a second but that is a separate issue), click on the menu item to delete the model
  • error message appears in console, UI hangs

Expected behavior

  • deleting any model cancels existing profiling operation gracefully, UI remains responsive

bcolloran avatar Jun 27 '22 20:06 bcolloran