MixerUtil lock times out when a collection of transients use the same mixin

Description

Due to the 15 second exclusive lock in `coldbox/system/core/dynamic/MixerUtil.cfc:46`, a long running task, which uses the same mixin and instantiates a collection of transients, which use the same mixin, will throw the following error:

An example of this might be:

Where `dateFormatHelper.cfm` contains a couple of methods which assist in formatting times to ISO8601 formats - a very lightweight mixin.

Normalizing the required function in to the transient component ( or its chain of inheritance ) solves, the issue but decreases the ability to re-use code.

Activity

Show:
Luis Majano
November 16, 2017, 5:34 PM

Jon I can address the issue. However I believe that he approach is not very scalable due to the fact that you are mixin methods at runtime. I think it would be safer and preferable to actually make that a utility cfc and inject it. This will provide you with an object graph instead of method injection. Anyways, as a rule I tend to stay away from mixins if I can do injections

Jon Clausen
November 17, 2017, 12:51 AM

I think that's a valid push back. I like the two helper functions that mixin provides as first-class functions inside the code ( e.g. `dateFormatISO8601( now() )`, but it's probably better to deal with it as a singleton util component and write a few extra characters.

Out of curiosity, why the lock around the object mixin? Is that a thread safety issue?

Luis Majano
November 17, 2017, 10:28 PM

I am not sure yet still leaving this open to address it anyways.

Fixed

Assignee

Luis Majano

Reporter

Jon Clausen

Labels

None

Components

Fix versions

Priority

Major
Configure