| Summary: | SocketUtil.isLocalhost() method takes a long time | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP ServerTools | Reporter: | Rajiv Senthilnathan <rajiv.senthilnathan> | ||||||
| Component: | wst.server | Assignee: | Elson Yuen <eyuen7> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Angel Vera <arvera> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | arvera, david_williams, eyuen7 | ||||||
| Version: | unspecified | Flags: | david_williams:
pmc_approved+
arvera: pmc_approved? (raghunathan.srinivasan) arvera: pmc_approved? (naci.dai) arvera: pmc_approved? (deboer) arvera: pmc_approved? (neil.hauge) arvera: pmc_approved? (kaloyan) arvera: review+ |
||||||
| Target Milestone: | 3.2.2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| See Also: | https://git.eclipse.org/r/108988 | ||||||||
| Whiteboard: | PMC_approved | ||||||||
| Attachments: |
|
||||||||
|
Description
Rajiv Senthilnathan
Created attachment 177280 [details] Proposed Patch Proposed patch for Bug 323455 - SocketUtil.isLocalhost() method takes a long time See bug defect description for details on what the patch does. Please assign this one to me. There are a couple of things that needs to be changed on the patch. I'll create a new patch for it: 1. a couple of accessing and updating on the cache objects are not within the synchronized of the lock object that may causes problems. 2. InetAddress.getLocalHost() is being called more than once within the method and should be using the cached value to make the method perform better. 3. After the check on: if (host.equals(localHostaddr.getHostName().toLowerCase()) || host.equals(localHostaddr.getCanonicalHostName().toLowerCase()) || host.equals(localHostaddr.getHostAddress().toLowerCase())) return true; The host should be added to the localHostCache to cache the result. Created attachment 177458 [details]
v1.0
This patch addresses the problems that I have mentioned on the previous comment.
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. Although not a stop-ship. Performance fixes are always better to be included and considered important for the overall performance of the product. * Is there a work-around? If so, why do you believe the work-around is insufficient? No workaround available. * How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? All JUnits run and some manual test. * Give a brief technical overview. Who has reviewed this fix? I(Angel) reviewed the fix. The changes look good. * What is the risk associated with this fix? Medium, since we are now making use of proper caching there could be a potential problem if the cache is not maintain properly. The proper testing of this fix minimizes the risk. (In reply to comment #3) The patch is missing the copyright updates, so I will include that when I commit the code. Thanks for the fast PMC approval. Changes committed and released to 32M Changes committed and released to HEAD (3.3) New Gerrit change created: https://git.eclipse.org/r/108988 |