MantisBT - Open CASCADE
View Issue Details
0029195Open CASCADE[OCCT] OCCT:Application Frameworkpublic2017-10-09 12:142020-09-15 13:44
abv 
abv 
normalminor 
verifiedfixed 
 
[OCCT] 7.5.0 
bugs caf bug29195_1
0029195: OCAF - ensure thread safety for different documents
For OCAF to be usable in multithreaded server applications where the same server process should handle multiple documents, we need to ensure that OCAF is thread safe, starting from scenarios where each thread is processing its own document.

Currently known possible sources of non-safety are:

- CDF_Session singleton and application stored in it -- they are called by some functions to get some defaults (search for "CurrentApplication")

- Version of the document being read is recorded during retrieval in the global variable - see BinMDataStd::DocumentVersion(). This can be moved to RElocation table, see 0029014
bugs caf bug29195_1
No tags attached.
related to 0026491closed abv Open CASCADE Incorrect OCAF format management 
related to 0029014closed bugmaster Community Managing Binary Format Versions Is Not Possible for Own TDF_Attributes 
related to 0031769reviewed bugmaster Open CASCADE Application Framework - regression : can not initialize two kinds of application in one thread 
7z tests29195.7z (1,604,239) 2018-08-07 18:04
https://tracker.dev.opencascade.org/
Issue History
2017-10-09 12:14abvNew Issue
2017-10-09 12:14abvAssigned To => mpv
2017-10-09 12:14abvRelationship addedrelated to 0026491
2017-10-09 12:14abvRelationship addedrelated to 0029014
2017-10-11 16:19mpvAssigned Tompv => szy
2017-11-23 16:06szyStatusnew => assigned
2017-11-23 16:49szyNote Added: 0072449
2017-11-23 16:49szyAssigned Toszy => abv
2017-11-23 16:49szyStatusassigned => feedback
2017-12-02 20:25abvNote Added: 0072669
2017-12-02 20:25abvAssigned Toabv => szy
2018-08-07 10:31gitNote Added: 0078448
2018-08-07 17:59gitNote Added: 0078475
2018-08-07 18:04szyFile Added: tests29195.7z
2018-08-08 17:25gitNote Added: 0078500
2018-08-08 18:31gitNote Added: 0078507
2018-08-14 16:55gitNote Added: 0078605
2018-08-14 18:04gitNote Added: 0078609
2018-08-15 12:18gitNote Added: 0078622
2018-08-15 17:55gitNote Added: 0078635
2018-08-17 17:38gitNote Added: 0078668
2018-08-20 18:51gitNote Added: 0078697
2018-08-21 10:39gitNote Added: 0078701
2018-08-22 11:29gitNote Added: 0078714
2018-09-07 18:45gitNote Added: 0079036
2018-10-19 17:36gitNote Added: 0080146
2018-11-08 16:31gitNote Added: 0080970
2018-12-25 14:34gitNote Added: 0081619
2018-12-26 16:29gitNote Added: 0081632
2019-07-10 09:01abvTarget Version7.4.0 => 7.5.0
2019-09-27 12:10szyResolutionopen => suspended
2020-08-26 10:13gitNote Added: 0093636
2020-08-26 15:56gitNote Added: 0093644
2020-08-26 21:19gitNote Added: 0093655
2020-08-27 14:41gitNote Added: 0093668
2020-08-28 12:49gitNote Added: 0093685
2020-08-28 14:52gitNote Added: 0093696
2020-08-31 10:43gitNote Added: 0093753
2020-08-31 17:05mpvNote Added: 0093770
2020-08-31 17:05mpvAssigned Toszy => vro
2020-08-31 17:05mpvStatusfeedback => resolved
2020-08-31 17:05mpvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=23272#r23272
2020-09-09 09:32vroNote Added: 0094278
2020-09-09 09:32vroAssigned Tovro => bugmaster
2020-09-09 09:32vroStatusresolved => reviewed
2020-09-09 19:41bugmasterNote Added: 0094319
2020-09-09 19:41bugmasterAssigned Tobugmaster => mpv
2020-09-09 19:41bugmasterStatusreviewed => assigned
2020-09-09 19:41bugmasterNote Edited: 0094319bug_revision_view_page.php?bugnote_id=94319#r23383
2020-09-09 19:42bugmasterNote Edited: 0094319bug_revision_view_page.php?bugnote_id=94319#r23384
2020-09-10 09:08gitNote Added: 0094345
2020-09-10 09:12mpvNote Added: 0094346
2020-09-10 09:12mpvStatusassigned => resolved
2020-09-10 09:12mpvAssigned Tompv => bugmaster
2020-09-10 09:12mpvStatusresolved => reviewed
2020-09-11 14:50gitNote Added: 0094457
2020-09-13 11:05bugmasterNote Added: 0094545
2020-09-13 11:05bugmasterStatusreviewed => tested
2020-09-13 11:17bugmasterTest case number => bugs caf bug29195_1
2020-09-13 11:24abvChangeset attached => occt master d9d03f10
2020-09-13 11:24abvAssigned Tobugmaster => abv
2020-09-13 11:24abvStatustested => verified
2020-09-13 11:24abvResolutionsuspended => fixed
2020-09-13 11:44gitNote Added: 0094567
2020-09-13 11:48gitNote Added: 0094637
2020-09-13 11:48gitNote Added: 0094638
2020-09-13 11:48gitNote Added: 0094639
2020-09-13 11:48gitNote Added: 0094640
2020-09-13 11:48gitNote Added: 0094641
2020-09-13 11:48gitNote Added: 0094642
2020-09-13 11:48gitNote Added: 0094643
2020-09-13 11:48gitNote Added: 0094644
2020-09-13 11:48gitNote Added: 0094645
2020-09-13 11:48gitNote Added: 0094646
2020-09-13 11:48gitNote Added: 0094647
2020-09-13 11:48gitNote Added: 0094648
2020-09-15 13:44mpvRelationship addedrelated to 0031769

Notes
(0072449)
szy   
2017-11-23 16:49   
Could you explain your idea when "the same server process should handle multiple documents" in more details. It is not clear connection of of CDF_Session with multiple documents processing. Current architecture supposes only one Session at the top. 1 Session => 1 Application => 1 Document. For sure you can open new document (it will be added to the internal List) and switch to it. Session just can provide list of opened (in session) documents. May be you mean problem of this list processing?
(0072669)
abv   
2017-12-02 20:25   
Imagine a server that runs multiple threads within one process, handling different requests from clients. In the current state of OCAF, if each thread will try to load its own OCAF document, they will conflict due to OCAF architecture assuming single document per process.
(0078448)
git   
2018-08-07 10:31   
Branch CR29195 has been created by szy.

SHA-1: 1e96c8eb30dc630673ae71551bed95a8115d1562


Detailed log of new commits:

Author: szy
Date: Tue Aug 7 10:29:22 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multythreading criteria.
(0078475)
git   
2018-08-07 17:59   
Branch CR29195 has been updated by szy.

SHA-1: 393fcd3be5ae1520a5da9c24818ee71f892f1115


Detailed log of new commits:

Author: szy
Date: Tue Aug 7 17:57:54 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // adding test cases.

(0078500)
git   
2018-08-08 17:25   
Branch CR29195_1 has been created by szy.

SHA-1: b62c03e90b4904bb0d3be78a501e0af31e8777d2


Detailed log of new commits:

Author: szy
Date: Wed Aug 8 17:24:06 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multi-threading criteria.
(0078507)
git   
2018-08-08 18:31   
Branch CR29195_1 has been updated by szy.

SHA-1: 81f58e63798bf0883e43092209ca71d49a0c54ff


Detailed log of new commits:

Author: szy
Date: Wed Aug 8 18:30:07 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Correction of warnings on MacOS.

(0078605)
git   
2018-08-14 16:55   
Branch CR29195_2 has been created by szy.

SHA-1: 87e8be2e152255aafd330981738160e52ac12f6a


Detailed log of new commits:

Author: szy
Date: Wed Aug 8 17:24:06 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Fix of compilation errors.
    
    0029195: OCAF - ensure thread safety for different documents.
    
    // Correction of warnings on MacOS.
    
    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multi-threading criteria.
(0078609)
git   
2018-08-14 18:04   
Branch CR29195_2 has been updated by szy.

SHA-1: 81670ad301d2494e7d4715549c8962e0125277df


Detailed log of new commits:

Author: szy
Date: Tue Aug 14 18:01:55 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Fix compilation errors on MacOS.

(0078622)
git   
2018-08-15 12:18   
Branch CR29195_3 has been created by szy.

SHA-1: b721073ca43feaa9450d023fa53120dacfdaf4bc


Detailed log of new commits:

Author: szy
Date: Wed Aug 15 12:16:33 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Fixing warnings on Linux.
(0078635)
git   
2018-08-15 17:55   
Branch CR29195_3 has been updated by szy.

SHA-1: aec50c02c87b4ef82f0d36dffc25a1558aebf638


Detailed log of new commits:

Author: szy
Date: Wed Aug 15 17:53:01 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Fixing CSharp and Java Samples (Removing obsolete method from CDF_Application).

(0078668)
git   
2018-08-17 17:38   
Branch CR29195_4 has been created by szy.

SHA-1: ad8352dcc5d1d972687e8a593618bd93ea3328b0


Detailed log of new commits:

Author: szy
Date: Fri Aug 17 17:36:07 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Fixing TObj testing bugs.
(0078697)
git   
2018-08-20 18:51   
Branch CR29195_5 has been created by szy.

SHA-1: 506de23937dda85c4eed53a37a7b267952df9efb


No new revisions were added by this update.
(0078701)
git   
2018-08-21 10:39   
Branch CR29195_6 has been created by szy.

SHA-1: 9f1a4f137529cff46784f6154c6da9994483815b


Detailed log of new commits:

Author: szy
Date: Tue Aug 21 10:37:13 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Adding lost fix to TObjDRAW.cxx
(0078714)
git   
2018-08-22 11:29   
Branch CR29195_7 has been created by szy.

SHA-1: 2a1bde0ed340d8b392c5b5ed63026596b4fba2ad


Detailed log of new commits:

Author: szy
Date: Wed Aug 8 17:24:06 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multi-threading criteria.
(0079036)
git   
2018-09-07 18:45   
Branch CR29195_8 has been created by szy.

SHA-1: 3f244e6c954374e19d364ab9df3300e3e44dc876


Detailed log of new commits:

Author: szy
Date: Wed Aug 8 17:24:06 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multi-threading criteria.
(0080146)
git   
2018-10-19 17:36   
Branch CR29195_9 has been created by szy.

SHA-1: 734676f8676b4ba7f3a8aa5926362e6240c36a25


Detailed log of new commits:

Author: szy
Date: Fri Oct 19 17:34:39 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Rebase on CR30169

Author: szy
Date: Tue Oct 9 17:30:10 2018 +0300

    0030169: Application Framework - Document format version management improvement.
    
    // Combined to one.
(0080970)
git   
2018-11-08 16:31   
Branch CR29195_10 has been created by szy.

SHA-1: 777bdc64ff31aa188bd4cbd4b6784e99d6fbbb3e


Detailed log of new commits:

Author: szy
Date: Thu Nov 8 16:28:56 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // fixing Linux bugs

Author: szy
Date: Fri Oct 19 17:34:39 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // Rebase on CR30169
(0081619)
git   
2018-12-25 14:34   
Branch CR29195_11 has been created by szy.

SHA-1: 613278b343149d93848ac4c4de0a222be7dec8fb


Detailed log of new commits:

Author: szy
Date: Tue Dec 25 14:30:40 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multi-threading criteria.
(0081632)
git   
2018-12-26 16:29   
Branch CR29195_11 has been updated by szy.

SHA-1: 6afafece3a8fa129dd5c81187e35a81832fc64b9


Detailed log of new commits:

Author: szy
Date: Wed Dec 26 16:26:01 2018 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    //Turn off debug (log) information.

(0093636)
git   
2020-08-26 10:13   
Branch CR29195_12 has been created by mpv.

SHA-1: fce1dedac3f86591faba24a3e2aa3439edda1215


Detailed log of new commits:

Author: mpv
Date: Wed Aug 26 10:15:22 2020 +0300

    0029195: OCAF - ensure thread safety for different documents.
    
    // OCAF persistence architecture modification to satisfy multi-threading criteria.
(0093644)
git   
2020-08-26 15:56   
Branch CR29195_12 has been updated by mpv.

SHA-1: 89cbefafb089aea5a6cbfccaedeed82d7860ca34


Detailed log of new commits:

Author: mpv
Date: Wed Aug 26 15:59:35 2020 +0300

    # Compilation problems fix.

(0093655)
git   
2020-08-26 21:19   
Branch CR29195_12 has been updated by mpv.

SHA-1: c0eb6440a4aa340082bf21b37a33d51210f4bd26


Detailed log of new commits:

Author: mpv
Date: Wed Aug 26 21:22:23 2020 +0300

    # Fixed problem found in unit-test: if progress bar does not defined, binary file can not be retrieved

(0093668)
git   
2020-08-27 14:41   
Branch CR29195_12 has been updated by mpv.

SHA-1: c722e382c1d67df28dec726d82fe6b016c8bcc65


Detailed log of new commits:

Author: mpv
Date: Thu Aug 27 14:44:18 2020 +0300

    // Fix the test-case, make parallel threads execution more stable

(0093685)
git   
2020-08-28 12:49   
Branch CR29195_12 has been updated by mpv.

SHA-1: 1dd588edbb8a6fbac61083638818f2fd6be6046e


Detailed log of new commits:

Author: mpv
Date: Fri Aug 28 12:52:09 2020 +0300

    # Fix the test problem if number of cores is not 4

(0093696)
git   
2020-08-28 14:52   
Branch CR29195_12 has been updated by mpv.

SHA-1: ead2b14cdd55fabcf7ec665b3c6faa63f744adbb


Detailed log of new commits:

Author: mpv
Date: Fri Aug 28 14:55:00 2020 +0300

    # Fixed the problem of output files in the test: they can not be written to the same directory as input files.

(0093753)
git   
2020-08-31 10:43   
Branch CR29195_12 has been updated by mpv.

SHA-1: 9244c09e4bcf8a6c128e853207c972095554dac3


Detailed log of new commits:

Author: mpv
Date: Mon Aug 31 10:45:40 2020 +0300

    # Fixed the problem when the application was created second time in one thread. In this case resulting pointer was corrupted because handle was created in AddToSession

(0093770)
mpv   
2020-08-31 17:05   
Fixed in the branch CR29195_12: merged with the current version modifications after the long delay, adapted test-cases. Please, review.

http://occt-tests/CR29195_12-master-MPV-OCCT/Windows-64-VC14/diff_summary.html [^]
http://occt-tests/CR29195_12-master-MPV-Products/Windows-64-VC14/diff_summary.html [^]
http://occt-tests/CR29195_12-master-MPV-OCCT/Debian80-64/diff_summary.html [^]
http://occt-tests/CR29195_12-master-MPV-Products/Debian80-64/diff_summary.html [^]
(0094278)
vro   
2020-09-09 09:32   
Reviewed! Tested a set of documents in multithreaded mode (Create/Open, Set/Get data, Save...) - it works fine even for 1000 threads.
(0094319)
bugmaster   
2020-09-09 19:41   
(edited on: 2020-09-09 19:42)
1. Please define after reviewing what should be integrated:

OCCT branch: NUMBER | NOTHING
Products branch: NUMBER | NOTHING

We already discussed it a lot of time

2. Please tomorrow rebase OCCT branch CR29195_12 to branch WEEK-37 because conflicts

(0094345)
git   
2020-09-10 09:08   
Branch CR29195_12 has been updated forcibly by mpv.

SHA-1: 7a98721106e0977ceb667caf12ef6d22f9b724d9
(0094346)
mpv   
2020-09-10 09:12   
OCCT branch CR29195_12 is rebased to branch WEEK-37
Products branch: NOTHING
(0094457)
git   
2020-09-11 14:50   
Branch CR29195_12 has been updated by mpv.

SHA-1: 7b7b0e0f74e3791c9e62b028072d4ac37001a3b1


Detailed log of new commits:

Author: mpv
Date: Fri Sep 11 14:53:37 2020 +0300

    # fix of warnings on VC12

(0094545)
bugmaster   
2020-09-13 11:05   
Combination -
OCCT branch : IR-2020-09-11
master SHA - d1b25684e9402d995dafec22fb98f83957d5fb76
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-09-11 SHA - a7e55a291cf6642cb4af945a999deeeb5f91272a
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17333.360000000142 / 17325.800000000123 [+0.04%]
Products
Total CPU difference: 12056.720000000096 / 12079.64000000011 [-0.19%]
Windows-64-VC14:
OCCT
Total CPU difference: 18817.921875 / 18792.46875 [+0.14%]
Products
Total CPU difference: 13294.09375 / 13274.75 [+0.15%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0094567)
git   
2020-09-13 11:44   
Branch CR29195_12 has been deleted by inv.

SHA-1: 7b7b0e0f74e3791c9e62b028072d4ac37001a3b1
(0094637)
git   
2020-09-13 11:48   
Branch CR29195_11 has been deleted by inv.

SHA-1: 6afafece3a8fa129dd5c81187e35a81832fc64b9
(0094638)
git   
2020-09-13 11:48   
Branch CR29195_10 has been deleted by inv.

SHA-1: 777bdc64ff31aa188bd4cbd4b6784e99d6fbbb3e
(0094639)
git   
2020-09-13 11:48   
Branch CR29195_9 has been deleted by inv.

SHA-1: 734676f8676b4ba7f3a8aa5926362e6240c36a25
(0094640)
git   
2020-09-13 11:48   
Branch CR29195_8 has been deleted by inv.

SHA-1: 3f244e6c954374e19d364ab9df3300e3e44dc876
(0094641)
git   
2020-09-13 11:48   
Branch CR29195_7 has been deleted by inv.

SHA-1: 2a1bde0ed340d8b392c5b5ed63026596b4fba2ad
(0094642)
git   
2020-09-13 11:48   
Branch CR29195_6 has been deleted by inv.

SHA-1: 9f1a4f137529cff46784f6154c6da9994483815b
(0094643)
git   
2020-09-13 11:48   
Branch CR29195_5 has been deleted by inv.

SHA-1: 506de23937dda85c4eed53a37a7b267952df9efb
(0094644)
git   
2020-09-13 11:48   
Branch CR29195_4 has been deleted by inv.

SHA-1: ad8352dcc5d1d972687e8a593618bd93ea3328b0
(0094645)
git   
2020-09-13 11:48   
Branch CR29195_3 has been deleted by inv.

SHA-1: aec50c02c87b4ef82f0d36dffc25a1558aebf638
(0094646)
git   
2020-09-13 11:48   
Branch CR29195_2 has been deleted by inv.

SHA-1: 81670ad301d2494e7d4715549c8962e0125277df
(0094647)
git   
2020-09-13 11:48   
Branch CR29195_1 has been deleted by inv.

SHA-1: 81f58e63798bf0883e43092209ca71d49a0c54ff
(0094648)
git   
2020-09-13 11:48   
Branch CR29195 has been deleted by inv.

SHA-1: 393fcd3be5ae1520a5da9c24818ee71f892f1115