-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Servlet instances leak custodian-managed resources #34
Comments
Are you referring to how I believe it was designed under the assumption that an unreachable custodian is shutdown automatically, but it seems that you're saying that is not true? Do you have a problem case? (I am ever so slightly skeptical because this path is only used when you (a) use the deprecated command-line tool or (b) use Supposing this is the problem, I think the solution is to change |
Yes, that's what I'm referring to. I should have been more specific. I don't think unreachable custodians are shut down. The docs vaguely suggest not and I can't see that behavior in tests. I'm using If you're skeptical this should be a problem, then I'm more interested in a better design. Otherwise, I can submit a PR with the change. |
Okay, I think we should do the change. Maybe we can get confirmation from @mflatt that unreachable custodians don't get shutdown. |
Custodians are themselves custodian-managed objects, so they don't really become unreachable and they aren't shut down implicitly. |
Ah, that makes sense!
…On Mon, Dec 11, 2017 at 2:15 PM, Matthew Flatt ***@***.***> wrote:
Custodians are themselves custodian-managed objects, so they don't really
become unreachable and they aren't shut down implicitly.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOM-lnn8mjnd95hsbAcgli-MT3WrQhoks5s_X9ggaJpZM4Q86mL>
.
--
-=[ Jay McCarthy http://jeapostrophe.github.io ]=-
-=[ Associate Professor PLT @ CS @ UMass Lowell ]=-
-=[ Moses 1:33: And worlds without number have I created; ]=-
|
The docs say that custodians only weakly reference the objects they manage and only weakly reference their subordinate custodians. What am I missing? |
Ok, but the docs also say that a custodian takes over a disappearing subordinate custodian's objects. The weak reference may actually be implemented by ordered finalization, and |
@kimmyg are you satisfied with the discussion? Do you think the docs should be changed? (To put the question differently: do you consider this issue closed?) |
I think the docs should warn that the default behavior can leak resources. Specifically, I would welcome a change in the documentation for
to
(or similar). With such a documentation change, I would consider this issue closed. If my particular change is acceptable, I'm happy to make it in a pull request tomorrow. |
That looks like a sensible addition to the docs to me. @mflatt & @jeapostrophe would you agree? |
Agree |
When servlet instances are flushed (selectively or not), the only action taken is that servlet instance references are discarded. In particular, resources managed by the servlet custodian are not shut down but are instead managed (directly) by the superordinate custodian.
Should the servlet custodian be shut down when the instance is flushed?
For my use case (spawning a service thread), it looks like I can get by with a will, but shutting down the custodian seems like a more “natural” general policy. (And maybe it is, but is also a breaking change. Is that the case?)
The text was updated successfully, but these errors were encountered: