View Issue Details

IDProjectCategoryView StatusLast Update
931RackTablesIPv4/IPv6/SLBpublic2014-02-02 07:37
Reporterheraclide Assigned Toandriyanov  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionwon't fix 
Product Version0.20.3 
Summary931: scanRealmByText + commitAddObject + bindIpToObject => "Uncaught exception 'EntityNotFoundException'"
DescriptionI'm currently in the process of writing webservices to racktables to automatize data update in a hosting company.

So, i made a create.php file, which basically do:
scanRealmByText ( to check that object don't already exists in database )
and then commitAddObject
and then bindIpToObject

The problem is that the scanRealmByText push in $entityCache that the object don't exists, and then when bindIpToObject execute, it fails with spotEntity hitting the cache
Steps To Reproduce$_res = scanRealmByText('object', '{$cn_SOMETHING}');

if ( sizeof( $_res) > 0) {
  exit;
}

$_objId = commitAddObject ( 'SOMETHING', 'Label', 122334, 'AZERTY');

bindIPToObject( ip_parse( "1.2.3.4") , $_objId, 'SOMETHING','regular');
Additional InformationFix can be found at : https://github.com/heraclide/racktables/commit/9954d61077ce94c5b3f2ead7cbb2ca7c5bfe48d8
TagsNo tags attached.

Activities

andriyanov

andriyanov

2013-07-11 17:21

reporter   ~0001595

Hello. Caching needs to be refactored at all, I made an attempt in the 'caching' branch, but is not merged yet. I hope to return to this work soon.

The cache is stored in the global var $entityCache, so it is possible to invalidate it from any function. The temporary solution is to clear the cache after calling of commitAddObject().

I don't like your patch, because it fixes only one of many issues (almost any call to spotEntity could use invalid cache in some cases). Updating the cache in the commitAddObject() makes more sense to me.

Issue History

Date Modified Username Field Change
2013-07-11 15:45 heraclide New Issue
2013-07-11 15:45 heraclide Status new => assigned
2013-07-11 15:45 heraclide Assigned To => andriyanov
2013-07-11 17:21 andriyanov Note Added: 0001595
2013-07-11 17:21 andriyanov Assigned To andriyanov =>
2013-07-11 17:21 andriyanov Assigned To => andriyanov
2014-02-02 07:37 andriyanov Status assigned => closed
2014-02-02 07:37 andriyanov Resolution open => won't fix