-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dissoc injected dependencies at shutdown #9
Comments
Thanks for the experience report. I'll have to think about this one for a while. I don't want to preclude other lifecycles, and the dependency propagation is tricky. There may be a problem with One thing: components are often records. |
Before this change, `update-system-reverse` did not propagate dependencies properly in a way consistent with `update-system`. Dependency propagation always has to happen in *normal* dependency order, not reverse dependency order. See also #9
After some work and experimentation on the reverse-dependencies branch, I don't think this is going to work. Propagating dependencies backwards proved very difficult to do correctly. Records-as-components means that I never intended that I also never intended that system maps should be printable. They will always have lots of repetition, and may contain large objects such as caches. I will make a note of this in the README, probably similar to 03c263c. |
Behavior of |
As of release 0.2.2, system map defines a print-method to avoid accidentally printing large objects at the REPL. |
I noticed and I like it, makes a big improvement. On Thursday, September 18, 2014, Stuart Sierra [email protected]
Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to (971) 678-5210 |
Given that the system will "inject" dependencies into a component map (via
assoc
), I believe it should, at system shutdown,dissoc
those same keys.In my particular situation, I had a component that was a wrapper around a C3P0 connection pool. As part of
stop
, the connection pool was itself.close
-d.However, the component had been propagated to another component as a dependency.
After the successful shutdown, the SystemMap is printed to the console (in the REPL). The migrations component still included the injected key to the connection pool manager, and so the C3P0 connection pool received
toString()
, which (and this is a separate comment on the quality of C3P0) caused it to spin its wheels for 30 seconds and eventually report an OutOfMemoryException wrapped in an InvocationTargetException.I've modified my code to
dissoc
any dependencies injected by the system, but I strongly feel that this needs to be either strongly noted in the documentation OR automatically performed bystop
. I'd prefer the latter.And I'd be happy to submit a patch, but I know how you feel about them.
The text was updated successfully, but these errors were encountered: