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

make sed extraction asynchronous and safer #345

Merged
merged 2 commits into from
Dec 28, 2016

Conversation

olaurino
Copy link
Member

I can't reproduce ChandraCXC/iris-dev#128. However, investigating the issue I found out the implementation of the extraction could be made safer and asynchronous. At the very least, if the issue can be reproduced on some systems, this PR should minimize it by a) not stopping the GUI thread and b) by creating and populating the SED first and adding it to the SedManager only when ready.

A couple of questions for @jbudynk on the UI. I didn't include a spinning wheel, do you think we need one? Also, I did not add a Stop button as the Stop functionality should be implemented, and I didn't look into what that would require. If you feel strongly we should add a Stop button I'll look into it, maybe after we have addressed the current outstanding issues.

@olaurino
Copy link
Member Author

olaurino commented Dec 20, 2016

On OSX I could not reproduce the issue, but I seemed to experience ChandraCXC/iris-dev#129 using the master branch. The issue seems to be resolved by this PR.

@jbudynk
Copy link
Member

jbudynk commented Dec 20, 2016

I agree that this PR resolves ChandraCXC/iris-dev#129. I cannot reproduce the issue on this branch.

I don't think we need a spinning wheel; it's clear to see that the tool is 'thinking' while the OK message is popping up, as the "Extract" button remains highlighted blue. The data seems to load in fine, and I'm able to switch to other windows after clicking "OK."

However, it seems like the asynchronous work is only done on the second refresh of the data, and not the first one. For example, the GUI is frozen before the OK message pops up. Is this something we can fix before AAS?

As discussed offline, we might be able to remove the extra "refresh" that happens on updating SEDs, which can be clearly seen with these changes with large SEDs. However, this should be added to a different issue; it should not be addressed here.

@jbudynk
Copy link
Member

jbudynk commented Dec 20, 2016

Ah woops, I might have understood the double refresh problem at first. The extra "refresh" I talk about in my previous comment must be the first SED refresh that occurs. So for the question I asked above -- can we do this asynchronously on the first refresh -- should be done in a different task.

@olaurino
Copy link
Member Author

olaurino commented Dec 20, 2016

I pushed a commit so the execution of preferences.addSed is sent to the EDT with invokeLater, which should prevent the GUI to freeze after the SED has been extracted and while it is added to the workspace.

@jbudynk
Copy link
Member

jbudynk commented Dec 28, 2016

OK to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants