锁定老帖子 主题:sun的程序员也是程序员啊!
该帖已经被评为精华帖
|
|
---|---|
作者 | 正文 |
发表时间:2010-05-05
最后修改:2010-05-07
"
HTTPBC-OutboundReceiver-221
"
daemon prio
=
3
tid
=
0x09872c00
nid
=
0x4bf9
runnable [
0xa7b56000
]
java.lang.Thread.State: RUNNABLE at java.util.zip.ZipFile.getEntry(Native Method) at java.util.zip.ZipFile.getEntry(ZipFile.java: 149 ) - locked < 0xbb09d458 > (a java.util.jar.JarFile) at java.util.jar.JarFile.getEntry(JarFile.java: 206 ) at java.util.jar.JarFile.getJarEntry(JarFile.java: 189 ) at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java: 754 ) at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java: 732 ) at sun.misc.URLClassPath$ 1 .next(URLClassPath.java: 195 ) at sun.misc.URLClassPath$ 1 .hasMoreElements(URLClassPath.java: 205 ) at java.net.URLClassLoader$ 3 $ 1 .run(URLClassLoader.java: 393 ) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader$ 3 .next(URLClassLoader.java: 390 ) at java.net.URLClassLoader$ 3 .hasMoreElements(URLClassLoader.java: 415 ) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java: 27 ) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java: 36 ) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java: 27 ) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java: 36 ) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java: 27 ) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java: 36 ) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java: 27 ) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java: 36 ) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java: 27 ) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java: 36 ) at com.sun.xml.ws.util.ServiceFinder$LazyIterator.hasNext(ServiceFinder.java: 357 ) at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java: 129 ) at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java: 112 ) at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java: 595 ) at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java: 554 ) at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java: 539 ) at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java: 436 ) - locked < 0xe8e3e200 > (a com.sun.xml.ws.api.pipe.Fiber) at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java: 106 ) at com.sun.xml.ws.tx.client.TxClientPipe.process(TxClientPipe.java: 177 ) at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java: 115 ) at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java: 595 ) at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java: 554 ) at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java: 539 ) at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java: 436 ) - locked < 0xe8e3e200 > (a com.sun.xml.ws.api.pipe.Fiber) at com.sun.xml.ws.client.Stub.process(Stub.java: 248 ) at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java: 180 ) at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java: 206 ) at com.sun.jbi.httpsoapbc.OutboundMessageProcessor.outboundCall(OutboundMessageProcessor.java: 1256 ) at com.sun.jbi.httpsoapbc.OutboundMessageProcessor.dispatch(OutboundMessageProcessor.java: 1296 ) at com.sun.jbi.httpsoapbc.OutboundMessageProcessor.processRequestReplyOutbound(OutboundMessageProcessor.java: 747 ) at com.sun.jbi.httpsoapbc.OutboundMessageProcessor.processMessage(OutboundMessageProcessor.java: 257 ) at com.sun.jbi.httpsoapbc.OutboundAction.run(OutboundAction.java: 63 ) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 886 ) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 908 ) at java.lang.Thread.run(Thread.java: 619 )
com.sun.xml.ws.util.ServiceFinder$LazyIterator.hasNext(ServiceFinder.java:
357
)
private static final String prefix = " META-INF/services/ " ; if (configs == null ) { String fullName = prefix + service.getName(); if (loader == null ) configs = ClassLoader.getSystemResources(fullName); else configs = loader.getResources(fullName); }
public
static
Tube create(@Nullable ClassLoader classLoader, @NotNull ClientTubeAssemblerContext context) {
for (TransportTubeFactory factory : ServiceFinder.find(TransportTubeFactory. class ,classLoader)) { Tube tube = factory.doCreate(context); if (tube != null ) { TransportTubeFactory.logger.fine(factory.getClass() + " successfully created " + tube); return tube; } }
public
NextAction processRequest(@NotNull Packet request) {
if (request.endpointAddress == address) // cache hit return transport.processRequest(request); ..... address = request.endpointAddress; transport = TransportTubeFactory.create(classLoader, newContext);
if
(request.endpointAddress
==
address )
public
NextAction processRequest(@NotNull Packet request) {
if (request.endpointAddress == address) // cache hit return transport.processRequest(request);
public
void
setEndPointAddressString(String s) {
if (s == null ) this .endpointAddress = null ; else this .endpointAddress = EndpointAddress.create(s); } public static EndpointAddress create(String url) { try { return new EndpointAddress(url); } catch (URISyntaxException e) { throw new WebServiceException( " Illegal endpoint address: " + url,e); } }
public
EndpointAddress endpointAddress;
if
(address
!=
null
&& address.getURI() != null && request.endpointAddress.getURI().equals(address.getURI())) { // cache hit return transport.processRequest(request); }
后续更新: 1. 下午做了这个bug解决前后的性能对比,相同机器相同环境
fix前: CPU: 89%-92% TPS:1111 AVG response time:71 fix后: CPU: 69%-71% TPS:1300 AVG response time:61
总结说就是fix之后,tps 提升接近20%,而cpu使用反而降低20%,平均响应时间减少14%。 反过来,看原来的这个bug对性能的影响有多大,如此差异仅仅源于一行代码而已。
2. 提交给sun的tr,24小时了,没有任何反应 好吧,不能指望sun了。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2010-05-05
1、对lz的钻研精神表示pf
2、有一个疑问,这个地方到底是bug,还是design |
|
返回顶楼 | |
发表时间:2010-05-05
最后修改:2010-05-05
kimmking 写道 1、对lz的钻研精神表示pf
2、有一个疑问,这个地方到底是bug,还是design 如果是design的话,则metor会要求使用者必须保证,针对每个endpointAddress地址的请求,它的request.endpointAddress必须是同一个实例,否则==无法成立。 这样就要求使用者必须实现以下逻辑,伪代码如下: HashMap<String, EndpointAddress> cache = ...; String address = ... EndpointAddress endpointAddress = cache.get(address); if (endpointAddress == null) { endpointAddress = new EndpointAddress () cache.put(address , endpointAddress ); } processRequest(request); 这样才能利用到metro中的cache,避免每次调用create(). 如果说是设计的话,就要求使用者必须知道并遵循这个游戏规则,我想基本的javadoc上应该要有所表现。很遗憾没有看到,而且从我们的案例上看,openESB,同为sun旗下的产品,他们没有做到。 如果说是bug的话,那么这个bug也未免大的离谱了点,我们正在联系sun看是否算bug,是否需要fix。毕竟,目前最新的版本依然还是用的是 == 。真是可怕啊! |
|
返回顶楼 | |
发表时间:2010-05-06
对楼主表示佩服,sun的人可能是因为自己从来是写代码而没实际用过把。
|
|
返回顶楼 | |
发表时间:2010-05-06
skydream 写道 ... 上metro的官网,找metor 相应版本的源文件,最接近的是2.1.3。 下载下来查看源码,恩,开源就是好啊 开源就是好啊,顶这句。 |
|
返回顶楼 | |
发表时间:2010-05-06
呵呵,你可以这样说
sun也招新手啊,早知道也投个简历过去了:) |
|
返回顶楼 | |
发表时间:2010-05-06
最后修改:2010-05-06
kimmking 写道 1、对lz的钻研精神表示pf
2、有一个疑问,这个地方到底是bug,还是design 另外,我直接就看不懂楼主的代码,还要学习 |
|
返回顶楼 | |
发表时间:2010-05-06
还是 要敬重 下Sun 的人
|
|
返回顶楼 | |
发表时间:2010-05-06
凡是软件都难免会有BUG ~
|
|
返回顶楼 | |
发表时间:2010-05-06
佩服楼主的钻研精神,感谢楼主的奉献精神。
也希望楼主在感叹sun程序员考虑不周的时候,在有余力的情况下,将此类bug及时报告给官方,让官方可以尽快修改这个bug。 越多的参与开发社区,越能左右影响项目的发展。不只是bug,任何好的想法,强力的feature都可以直接扔给开发社区,我觉得这是开源社区与公司实现共同利益的好方法。如果只在国内社区抱怨,对整个开源项目的影响太有限了。毕竟国内的commiter太少。很难及时反馈到官方。 其实像楼主这么能钻,只要有精力,去官方搞一个contributor下来也没问题,到时候有什么问题都在trunk下直接改了。方便啊。 |
|
返回顶楼 | |