You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Stefano Bagnara (JIRA)" <se...@james.apache.org> on 2006/11/08 13:36:56 UTC
[jira] Created: (JAMES-679) Make sure our container use an
expiration for cached dns data
Make sure our container use an expiration for cached dns data
-------------------------------------------------------------
Key: JAMES-679
URL: http://issues.apache.org/jira/browse/JAMES-679
Project: James
Issue Type: Improvement
Affects Versions: 2.3.0
Reporter: Stefano Bagnara
Assigned To: Stefano Bagnara
Fix For: 2.3.1-dev, Next Minor, Next Major, Trunk
Noel J. Bergman wrote:
> Stefano Bagnara wrote:
>> but it could happen (or maybe it already happen) that some third party
>> library we use still make use of InetAddress "flawed" methods, and the
>> above property would save us from the possible OutOfMemory because of
>> the unbounded cache.
>
> Perhaps, but I would rather vet the code, and be more careful about what we use. Now that we know one of the things to look for carefully, we can avoid it. The better solution is to avoid the problem, not mask it.
>
> --- Noel
I agree: we avoid it in trunk because of this.
About the "not masking" I think that even if we solved it we should better add the property because our users could easily make our mistakes and use InetAddress in their mailets. The fact that DNSServer is not part of the mailet apis incentivate them to use InetAdress and not the James Server specific service.
So I think we should really add the ttl property.
Either "-Dsun.net.inetaddr.ttl=10" in the command line or
java.security.Security.setProperty("networkaddress.cache.ttl" , "10");
Should work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] Commented: (JAMES-679) Make sure our container use an
expiration for cached dns data
Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
[ http://issues.apache.org/jira/browse/JAMES-679?page=comments#action_12449339 ]
Stefano Bagnara commented on JAMES-679:
---------------------------------------
Ok to change the 10 with 0.
About the setProperty: I think this property belong to the container, so I think we should better add it some phoenix class.
Anyone against this? I want to know before loosing my time searching for the right class ;-)
If someone is against, please tell where do you think this property belong.
> Make sure our container use an expiration for cached dns data
> -------------------------------------------------------------
>
> Key: JAMES-679
> URL: http://issues.apache.org/jira/browse/JAMES-679
> Project: James
> Issue Type: Improvement
> Affects Versions: 2.3.0
> Reporter: Stefano Bagnara
> Assigned To: Stefano Bagnara
> Fix For: Next Major
>
>
> Noel J. Bergman wrote:
> > Stefano Bagnara wrote:
> >> but it could happen (or maybe it already happen) that some third party
> >> library we use still make use of InetAddress "flawed" methods, and the
> >> above property would save us from the possible OutOfMemory because of
> >> the unbounded cache.
> >
> > Perhaps, but I would rather vet the code, and be more careful about what we use. Now that we know one of the things to look for carefully, we can avoid it. The better solution is to avoid the problem, not mask it.
> >
> > --- Noel
> I agree: we avoid it in trunk because of this.
> About the "not masking" I think that even if we solved it we should better add the property because our users could easily make our mistakes and use InetAddress in their mailets. The fact that DNSServer is not part of the mailet apis incentivate them to use InetAdress and not the James Server specific service.
> So I think we should really add the ttl property.
> Either "-Dsun.net.inetaddr.ttl=10" in the command line or
> java.security.Security.setProperty("networkaddress.cache.ttl" , "10");
> Should work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] Reopened: (JAMES-679) Make sure our container use an
expiration for cached dns data
Posted by "Noel J. Bergman (JIRA)" <se...@james.apache.org>.
[ http://issues.apache.org/jira/browse/JAMES-679?page=all ]
Noel J. Bergman reopened JAMES-679:
-----------------------------------
Please change this from 10 to 0, as in:
java.security.Security.setProperty("networkaddress.cache.ttl" , "0");
The change you made doesn't necessarily do what you think it does because the code in Sun's InetAddress.Cache implementation handles expiration only when the host name is queried or another entry is put (at which point it loops through the entire cache looking for expired entries). Otherwise, it just takes up space.
For our purposes, it would be better to use the InetAddressCachePolicy.NEVER special case.
> Make sure our container use an expiration for cached dns data
> -------------------------------------------------------------
>
> Key: JAMES-679
> URL: http://issues.apache.org/jira/browse/JAMES-679
> Project: James
> Issue Type: Improvement
> Affects Versions: 2.3.0
> Reporter: Stefano Bagnara
> Assigned To: Stefano Bagnara
> Fix For: Next Major
>
>
> Noel J. Bergman wrote:
> > Stefano Bagnara wrote:
> >> but it could happen (or maybe it already happen) that some third party
> >> library we use still make use of InetAddress "flawed" methods, and the
> >> above property would save us from the possible OutOfMemory because of
> >> the unbounded cache.
> >
> > Perhaps, but I would rather vet the code, and be more careful about what we use. Now that we know one of the things to look for carefully, we can avoid it. The better solution is to avoid the problem, not mask it.
> >
> > --- Noel
> I agree: we avoid it in trunk because of this.
> About the "not masking" I think that even if we solved it we should better add the property because our users could easily make our mistakes and use InetAddress in their mailets. The fact that DNSServer is not part of the mailet apis incentivate them to use InetAdress and not the James Server specific service.
> So I think we should really add the ttl property.
> Either "-Dsun.net.inetaddr.ttl=10" in the command line or
> java.security.Security.setProperty("networkaddress.cache.ttl" , "10");
> Should work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] Commented: (JAMES-679) Make sure our container use an
expiration for cached dns data
Posted by "Noel J. Bergman (JIRA)" <se...@james.apache.org>.
[ http://issues.apache.org/jira/browse/JAMES-679?page=comments#action_12449023 ]
Noel J. Bergman commented on JAMES-679:
---------------------------------------
I would agree with backporting
java.security.Security.setProperty("networkaddress.cache.ttl" , "0");
to v2.3.x/minor-next. Any reference to "-Dsun.net.inetaddr.ttl=10" should be eliminated, however. That has already been deprecated by Sun and is non-standard.
> Make sure our container use an expiration for cached dns data
> -------------------------------------------------------------
>
> Key: JAMES-679
> URL: http://issues.apache.org/jira/browse/JAMES-679
> Project: James
> Issue Type: Improvement
> Affects Versions: 2.3.0
> Reporter: Stefano Bagnara
> Assigned To: Stefano Bagnara
> Fix For: Next Major
>
>
> Noel J. Bergman wrote:
> > Stefano Bagnara wrote:
> >> but it could happen (or maybe it already happen) that some third party
> >> library we use still make use of InetAddress "flawed" methods, and the
> >> above property would save us from the possible OutOfMemory because of
> >> the unbounded cache.
> >
> > Perhaps, but I would rather vet the code, and be more careful about what we use. Now that we know one of the things to look for carefully, we can avoid it. The better solution is to avoid the problem, not mask it.
> >
> > --- Noel
> I agree: we avoid it in trunk because of this.
> About the "not masking" I think that even if we solved it we should better add the property because our users could easily make our mistakes and use InetAddress in their mailets. The fact that DNSServer is not part of the mailet apis incentivate them to use InetAdress and not the James Server specific service.
> So I think we should really add the ttl property.
> Either "-Dsun.net.inetaddr.ttl=10" in the command line or
> java.security.Security.setProperty("networkaddress.cache.ttl" , "10");
> Should work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] Resolved: (JAMES-679) Make sure our container use an
expiration for cached dns data
Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/JAMES-679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefano Bagnara resolved JAMES-679.
-----------------------------------
Reverted the sun specific change and applied the java standard solution (Security.setProperty)
---
Now james uses a default 300 seconds expiration for the positive dns results cache.
The expiration is tunable via system property -Dnetworkaddress.cache.ttl
Setting it to -1 will revert to the default "cache forever" JVM behaviour.
Setting it to 0 will remove caching at all.
Applied to trunk 4 days ago and backported to v2.3 (for 2.3.1) now.
---
Please note that the v2.3 branch dnsservice still uses InetAddress so this configuration is really important, while in following branches (derived from current trunk) we don't use InetAddress anymore and this is only a safety belt for Mailets we host. Most people is not aware of this never-expired cache in the JVM and we protect them from easy errors.
> Make sure our container use an expiration for cached dns data
> -------------------------------------------------------------
>
> Key: JAMES-679
> URL: https://issues.apache.org/jira/browse/JAMES-679
> Project: James
> Issue Type: Improvement
> Affects Versions: 2.3.0
> Reporter: Stefano Bagnara
> Assigned To: Stefano Bagnara
> Fix For: 2.3.1-dev
>
>
> Noel J. Bergman wrote:
> > Stefano Bagnara wrote:
> >> but it could happen (or maybe it already happen) that some third party
> >> library we use still make use of InetAddress "flawed" methods, and the
> >> above property would save us from the possible OutOfMemory because of
> >> the unbounded cache.
> >
> > Perhaps, but I would rather vet the code, and be more careful about what we use. Now that we know one of the things to look for carefully, we can avoid it. The better solution is to avoid the problem, not mask it.
> >
> > --- Noel
> I agree: we avoid it in trunk because of this.
> About the "not masking" I think that even if we solved it we should better add the property because our users could easily make our mistakes and use InetAddress in their mailets. The fact that DNSServer is not part of the mailet apis incentivate them to use InetAdress and not the James Server specific service.
> So I think we should really add the ttl property.
> Either "-Dsun.net.inetaddr.ttl=10" in the command line or
> java.security.Security.setProperty("networkaddress.cache.ttl" , "10");
> Should work.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] Resolved: (JAMES-679) Make sure our container use an
expiration for cached dns data
Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
[ http://issues.apache.org/jira/browse/JAMES-679?page=all ]
Stefano Bagnara resolved JAMES-679.
-----------------------------------
Fix Version/s: (was: 2.3.1-dev)
(was: Next Minor)
(was: Trunk)
Resolution: Fixed
Applied to trunk (next-major)
Imo we should backport this to v2.3 and next-minor branches, too.
> Make sure our container use an expiration for cached dns data
> -------------------------------------------------------------
>
> Key: JAMES-679
> URL: http://issues.apache.org/jira/browse/JAMES-679
> Project: James
> Issue Type: Improvement
> Affects Versions: 2.3.0
> Reporter: Stefano Bagnara
> Assigned To: Stefano Bagnara
> Fix For: Next Major
>
>
> Noel J. Bergman wrote:
> > Stefano Bagnara wrote:
> >> but it could happen (or maybe it already happen) that some third party
> >> library we use still make use of InetAddress "flawed" methods, and the
> >> above property would save us from the possible OutOfMemory because of
> >> the unbounded cache.
> >
> > Perhaps, but I would rather vet the code, and be more careful about what we use. Now that we know one of the things to look for carefully, we can avoid it. The better solution is to avoid the problem, not mask it.
> >
> > --- Noel
> I agree: we avoid it in trunk because of this.
> About the "not masking" I think that even if we solved it we should better add the property because our users could easily make our mistakes and use InetAddress in their mailets. The fact that DNSServer is not part of the mailet apis incentivate them to use InetAdress and not the James Server specific service.
> So I think we should really add the ttl property.
> Either "-Dsun.net.inetaddr.ttl=10" in the command line or
> java.security.Security.setProperty("networkaddress.cache.ttl" , "10");
> Should work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org