Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-open image probably uses cache #579

Closed
lh-astro opened this issue Aug 8, 2020 · 13 comments · Fixed by #875
Closed

Re-open image probably uses cache #579

lh-astro opened this issue Aug 8, 2020 · 13 comments · Fixed by #875
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lh-astro
Copy link

lh-astro commented Aug 8, 2020

System: Linux, Firefox 79.0-1 via carta.idia.ac.za

Issue description: Re-opening CASA image files after re-creation shows the first image not the updated one.

To reproduce:

  1. Opening a CASA image file in CARTA.
  2. Delete the file on the disk.
  3. Re-create the CARA image with different image parameters (only tested with same file size).
  4. In CARTA: File --> open image will not show the updated file, but the deleted one.

Workaround: In CARTA: Before opening the updated image do File --> Close image

@veggiesaurus
Copy link
Collaborator

Sounds like a backend issue. Will move it to that repo and assign to @pford.

@veggiesaurus veggiesaurus transferred this issue from CARTAvis/carta-frontend Aug 8, 2020
@veggiesaurus veggiesaurus added the bug Something isn't working label Aug 8, 2020
@veggiesaurus
Copy link
Collaborator

@pford is it possible that we're automatically reusing the file because it has the name?

@veggiesaurus
Copy link
Collaborator

wondering if adding something like a "reload image" entry to the context menu would be a more appropriate way of solving this issue. Changing the raw data of an image while it's open in CARTA seems to be asking for trouble

@pford
Copy link
Collaborator

pford commented Aug 17, 2020

There is an underlying casacore table manager which will open the image once and share the same Image object with any threads in the process. But CLOSE_FILE, sent by the frontend before OPEN_FILE, deletes this object. It should not be necessary for the user to close the image.

I tried to reproduce this by copying a different CASA image in step 3 to the same name, but the file browser showed the updated size and modified time, and "Open image" in step 4 showed the new image.

@pford
Copy link
Collaborator

pford commented Nov 2, 2020

@kswang1029 I cannot reproduce this issue. Will you try?

@kswang1029
Copy link
Contributor

kswang1029 commented Nov 3, 2020

@pford I did some experiments with our dev server with two CASA images with different pixel scales so that they have identical file size. However, following the instructions (for step3 I copy a template image to the test file name.) by @lh-astro I cannot reproduce the issue.

However, if we use append mode, then we see the issue. I think that is explained by @pford

There is an underlying casacore table manager which will open the image once and share the same Image object with any threads in the process. But CLOSE_FILE, sent by the frontend before OPEN_FILE, deletes this object. It should not be necessary for the user to close the image.

I also tried the FITS format and with append mode it works fine without the issue.

@kswang1029
Copy link
Contributor

kswang1029 commented Nov 3, 2020

@lh-astro If we use "load" to load an image, all loaded images will be closed first (with the CLOSE_FILE message). This should delete the image object(s) before creating a new one. Could you confirm again with v1.4 the procedure to reproduce the issue? Thanks.

@pford pford added the question Further information is requested label Nov 10, 2020
@kswang1029
Copy link
Contributor

@kswang1029 to check again

@jott3077
Copy link

jott3077 commented Jul 6, 2021

Could this go into an early v3? @kswang1029 mentioned that it would be scheduled for v2, but it seems to be still open and in CARTAvis/carta#45 it is reported still a problem in v2.0

@veggiesaurus
Copy link
Collaborator

Could this go into an early v3? @kswang1029 mentioned that it would be scheduled for v2, but it seems to be still open and in CARTAvis/carta#45 it is reported still a problem in v2.0

if we can find a consistent way to reproduce this, then it should be ok to schedule for the next beta, unless its something inherent in casacore

@kswang1029 kswang1029 added this to the v3.0b-1 milestone Jul 12, 2021
@kswang1029
Copy link
Contributor

temporily add to v3b1 release plan (depending on the issue complexity)

@pford
Copy link
Collaborator

pford commented Jul 12, 2021

I spoke to Kumar (on CASA imaging team) about this issue, and he was very puzzled. He stated that when an existing table is opened in another thread, the table manager will close it in the first thread and reopen in the second thread. So the second thread should have the new image.

@pford
Copy link
Collaborator

pford commented Jul 13, 2021

Tested with tclean script in Append mode, verified that appending an image creates a new Frame, FileLoader, and PagedImage for the new image, but the same tile data is sent from the backend for both images.

@pford pford removed the question Further information is requested label Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants