Bug 479862 - Closing the session with at least one editor not initialized can lead to a race condition
Summary: Closing the session with at least one editor not initialized can lead to a ra...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 2.0.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-10-15 10:11 EDT by Yvan Lussaud CLA
Modified: 2015-11-05 11:54 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yvan Lussaud CLA 2015-10-15 10:11:21 EDT
I'm using the v2.0.7

step to reproduce (it can be a bit random even with this steps):

open an Eclipse
open more than one diagram
close the Eclipse
reopen it (do not change the active Editor)
call Session.close() or IEditingSession.close()

If at some point an editor that was not initialized get the focus. It will start initializing while the Session is closing in the background.

A fix would be to close not initialized Editor first or the Editor with the focus last.
Comment 1 Esteban DUGUEPEROUX CLA 2015-11-05 11:54:48 EST
Indeed this is possible since the session closing is not thread safe, neither session opening. We should make session opening and closing thread safe, and prevents session reopening for a same session instance, i.e. once a session is closed to reopen it, it must be recreated through SessionManager.getSession().