Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035982
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServermajorhave not tried2017-05-12 09:522017-05-15 16:21
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in VersionRR17Q3
StatusclosedFix in branchFixed in SCM revisioncddd90ada4be
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomtaal
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035982: getMobileServersForOrganization and getNodeIdsForOrganization methods should return copies, not original sets

DescriptionThe MobileServerProvider has two methods that return the list of mobile servers / mobile server keys that have access to a given organization, called getMobileServersForOrganization and getNodeIdsForOrganization respectively.

These methods returns a set given an organization ID. The problem is that if the invokers then modify the set, then the original structure maintained in MobileServerProvider will be modified too.

Those methods should return copies of the original sets, to prevent having those sets modified.
Steps To ReproduceIt has been very difficult to reproduce, and only managed to do it in an environment of the BUT's development team when they were testing the Copy Store functionality.

In any case, the change makes a lot of sense, and should be done even if it cannot be reproduced deterministically.

Proposed SolutionReturn a copy of the sets instead of the original ones.

I tested the performance impact of making a copy of a set instead of returning the original one. With a set composed of 300 objects:
- Copying it once took 1ms
- Copying it 100 times took 2 ms
- Copying it 1000 times took 12 ms.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0035996RR17Q2.1 closedmtaal getMobileServersForOrganization and getNodeIdsForOrganization methods should return copies, not original sets 

-  Notes
(0096545)
hgbot (developer)
2017-05-12 09:59

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: cddd90ada4be19ddf51beb99edc23ac99fd585a5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri May 12 09:55:29 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/cddd90ada4be19ddf51beb99edc23ac99fd585a5 [^]

Fixes issue 35982: Methods return copies of sets, instead of original sets

The problem was that the MobileServerProvider getMobileServersForOrganization and getNodeIdsForOrganization methods were returning the original sets they maintained to keep track of what servers had access to each organization. If the invoker of those sets then modify them, then the original sets would be modified too.

Those methods must return copies of the sets, and not the original ones.

---
M src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java
---
(0096603)
mtaal (manager)
2017-05-15 16:17

Reviewed
(0096604)
mtaal (manager)
2017-05-15 16:20

creating new to create backport issue
(0096605)
mtaal (manager)
2017-05-15 16:21

back to closed

- Issue History
Date Modified Username Field Change
2017-05-12 09:52 AugustoMauch New Issue
2017-05-12 09:52 AugustoMauch Assigned To => AugustoMauch
2017-05-12 09:52 AugustoMauch Triggers an Emergency Pack => No
2017-05-12 09:59 hgbot Checkin
2017-05-12 09:59 hgbot Note Added: 0096545
2017-05-12 09:59 hgbot Status new => resolved
2017-05-12 09:59 hgbot Resolution open => fixed
2017-05-12 09:59 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/cddd90ada4be19ddf51beb99edc23ac99fd585a5 [^]
2017-05-12 09:59 AugustoMauch Review Assigned To => mtaal
2017-05-15 16:17 mtaal Note Added: 0096603
2017-05-15 16:17 mtaal Status resolved => closed
2017-05-15 16:17 mtaal Fixed in Version => RR17Q3
2017-05-15 16:20 mtaal Note Added: 0096604
2017-05-15 16:20 mtaal Status closed => new
2017-05-15 16:20 mtaal Resolution fixed => open
2017-05-15 16:20 mtaal Fixed in Version RR17Q3 =>
2017-05-15 16:20 mtaal Status new => scheduled
2017-05-15 16:20 mtaal Status scheduled => resolved
2017-05-15 16:20 mtaal Resolution open => fixed
2017-05-15 16:21 mtaal Note Added: 0096605
2017-05-15 16:21 mtaal Status resolved => closed
2017-05-15 16:21 mtaal Fixed in Version => RR17Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker