jdaviz icon indicating copy to clipboard operation
jdaviz copied to clipboard

Fix memory cleanup crashing loader selection in UI

Open rosteen opened this issue 1 month ago • 7 comments

Looks like some of the recent work cleaning up memory in tests is causing the loader in the UI to crash in some cases:

Screenshot 2025-11-04 at 1 17 56 PM

This checks for the existence of the spectrum attribute before trying to delete it.

rosteen avatar Nov 04 '25 18:11 rosteen

#3864 replaces this with self._clear_cache('spectrum') - can you check if that also fixes this or if that PR needs to be changed to adopt this instead?

I can try to check but I don't actually know a good way to consistently reproduce the crash, just that it happens sometimes.

rosteen avatar Nov 04 '25 18:11 rosteen

That does seem to fix this as well, since that is in draft do you want me to just copy that logic here?

rosteen avatar Nov 04 '25 18:11 rosteen

ok, I think _clear_cache is safer (since it isn't trying to delete a property), so we can get this in now and replace it with that in the other PR (or change this to use clear cache now). @MatthewPortman - do you see any memory implications to del vs _clear_cache?

kecnry avatar Nov 04 '25 18:11 kecnry

ok, I think _clear_cache is safer (since it isn't trying to delete a property), so we can get this in now and replace it with that in the other PR (or change this to use clear cache now). @MatthewPortman - do you see any memory implications to del vs _clear_cache?

None that I'm aware of, it should be fine

MatthewPortman avatar Nov 04 '25 19:11 MatthewPortman

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 87.51%. Comparing base (905b99a) to head (d0e5481). :warning: Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3872      +/-   ##
==========================================
- Coverage   87.52%   87.51%   -0.01%     
==========================================
  Files         191      191              
  Lines       26115    26124       +9     
==========================================
+ Hits        22857    22863       +6     
- Misses       3258     3261       +3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 04 '25 19:11 codecov[bot]

So what's the verdict? Go ahead and merge this to fix the bug for now and let the Roman PR change it to clearing cache?

rosteen avatar Nov 06 '25 17:11 rosteen

that's fine with me

kecnry avatar Nov 06 '25 18:11 kecnry