TransferORM / transfer

ColdFusion ORM library created by Mark Mandel, updated by @ghidinelli
Other
5 stars 3 forks source link

Transfer fails on initialization under load where methods/objects can't be found randomly #1

Closed ghidinelli closed 10 years ago

ghidinelli commented 10 years ago

Under load, starting Transfer can result in a wild variety of errors. See this thread for a long discussion on the ways it can fail:

https://groups.google.com/d/topic/transfer-dev/82Nx3lbNEyE/discussion

Errors include:

Could not find 'package.object' in 'transfer.xml'.
Expression: Unable to process the result of the XMLSearch for ''.
The requested object could not be found in the config file
Could not find 'theme.theme' in '/transfer/transfer.xml'.

The error occurred in /var/www/pukka/transfer/com/exception/Exception.cfc: line 30
Called from /var/www/pukka/transfer/com/object/exception/TransferObjectNotFoundException.cfc: line 31
Called from /var/www/pukka/transfer/com/object/ObjectDAO.cfc: line 71
Called from /var/www/pukka/transfer/com/object/ObjectManager.cfc: line 61
Called from /var/www/pukka/transfer/com/dynamic/KeyRationalise.cfc: line 41
Called from /var/www/pukka/transfer/com/dynamic/DynamicManager.cfc: line 59
Called from /var/www/pukka/transfer/com/Transfer.cfc: line 701
Called from /var/www/pukka/transfer/com/Transfer.cfc: line 98
Called from /var/www/pukka/model/theme/themeService.cfc: line 68

Adam Cameron created a test case that demonstrates that xmlSearch() is not thread safe and that, when it corrupts the in-memory XML object, it returns exactly the error that xmlSearch can't find anything for ''. Duplicating the XML object prior to searching resolves the issue with a very minor performance penalty (~3-5ms).

ghidinelli commented 10 years ago

Fixed in 46d9a211f6329d5bd1d0e9d97e1c161e440b8c20