Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_corba
提交
f2f1930e
D
dragonwell8_corba
项目概览
openanolis
/
dragonwell8_corba
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_corba
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f2f1930e
编写于
8月 16, 2012
作者:
C
coffeys
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7056731: Race condition in CORBA code causes re-use of ABORTed connections
Reviewed-by: lancea Contributed-by: d.macdonald@auckland.ac.nz
上级
7d6a3e58
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
47 addition
and
33 deletion
+47
-33
src/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java
...corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java
+45
-30
src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
...orba/se/impl/transport/SocketOrChannelConnectionImpl.java
+2
-3
未找到文件。
src/share/classes/com/sun/corba/se/impl/transport/CorbaResponseWaitingRoomImpl.java
浏览文件 @
f2f1930e
/*
* Copyright (c) 2001, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -25,7 +25,10 @@
package
com.sun.corba.se.impl.transport
;
import
java.util.Hashtable
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
org.omg.CORBA.CompletionStatus
;
import
org.omg.CORBA.SystemException
;
...
...
@@ -68,7 +71,7 @@ public class CorbaResponseWaitingRoomImpl
private
CorbaConnection
connection
;
// Maps requestId to an OutCallDesc.
private
Hashtable
out_calls
=
null
;
// REVISIT - use int hastable/map
final
private
Map
<
Integer
,
OutCallDesc
>
out_calls
;
public
CorbaResponseWaitingRoomImpl
(
ORB
orb
,
CorbaConnection
connection
)
{
...
...
@@ -76,7 +79,8 @@ public class CorbaResponseWaitingRoomImpl
wrapper
=
ORBUtilSystemException
.
get
(
orb
,
CORBALogDomains
.
RPC_TRANSPORT
)
;
this
.
connection
=
connection
;
out_calls
=
new
Hashtable
();
out_calls
=
Collections
.
synchronizedMap
(
new
HashMap
<
Integer
,
OutCallDesc
>());
}
////////////////////////////////////////////////////
...
...
@@ -139,7 +143,7 @@ public class CorbaResponseWaitingRoomImpl
return
null
;
}
OutCallDesc
call
=
(
OutCallDesc
)
out_calls
.
get
(
requestId
);
OutCallDesc
call
=
out_calls
.
get
(
requestId
);
if
(
call
==
null
)
{
throw
wrapper
.
nullOutCall
(
CompletionStatus
.
COMPLETED_MAYBE
);
}
...
...
@@ -197,7 +201,7 @@ public class CorbaResponseWaitingRoomImpl
LocateReplyOrReplyMessage
header
=
(
LocateReplyOrReplyMessage
)
inputObject
.
getMessageHeader
();
Integer
requestId
=
new
Integer
(
header
.
getRequestId
());
OutCallDesc
call
=
(
OutCallDesc
)
out_calls
.
get
(
requestId
);
OutCallDesc
call
=
out_calls
.
get
(
requestId
);
if
(
orb
.
transportDebugFlag
)
{
dprint
(
".responseReceived: id/"
...
...
@@ -248,7 +252,6 @@ public class CorbaResponseWaitingRoomImpl
public
int
numberRegistered
()
{
// Note: Hashtable.size() is not synchronized
return
out_calls
.
size
();
}
...
...
@@ -264,29 +267,41 @@ public class CorbaResponseWaitingRoomImpl
dprint
(
".signalExceptionToAllWaiters: "
+
systemException
);
}
OutCallDesc
call
;
java
.
util
.
Enumeration
e
=
out_calls
.
elements
();
while
(
e
.
hasMoreElements
())
{
call
=
(
OutCallDesc
)
e
.
nextElement
();
synchronized
(
call
.
done
){
// anything waiting for BufferManagerRead's fragment queue
// needs to be cancelled
CorbaMessageMediator
corbaMsgMediator
=
(
CorbaMessageMediator
)
call
.
messageMediator
;
CDRInputObject
inputObject
=
(
CDRInputObject
)
corbaMsgMediator
.
getInputObject
();
// IMPORTANT: If inputObject is null, then no need to tell
// BufferManagerRead to cancel request processing.
if
(
inputObject
!=
null
)
{
BufferManagerReadStream
bufferManager
=
(
BufferManagerReadStream
)
inputObject
.
getBufferManager
();
int
requestId
=
corbaMsgMediator
.
getRequestId
();
bufferManager
.
cancelProcessing
(
requestId
);
synchronized
(
out_calls
)
{
if
(
orb
.
transportDebugFlag
)
{
dprint
(
".signalExceptionToAllWaiters: out_calls size :"
+
out_calls
.
size
());
}
for
(
OutCallDesc
call
:
out_calls
.
values
())
{
if
(
orb
.
transportDebugFlag
)
{
dprint
(
".signalExceptionToAllWaiters: signaling "
+
call
);
}
synchronized
(
call
.
done
)
{
try
{
// anything waiting for BufferManagerRead's fragment queue
// needs to be cancelled
CorbaMessageMediator
corbaMsgMediator
=
(
CorbaMessageMediator
)
call
.
messageMediator
;
CDRInputObject
inputObject
=
(
CDRInputObject
)
corbaMsgMediator
.
getInputObject
();
// IMPORTANT: If inputObject is null, then no need to tell
// BufferManagerRead to cancel request processing.
if
(
inputObject
!=
null
)
{
BufferManagerReadStream
bufferManager
=
(
BufferManagerReadStream
)
inputObject
.
getBufferManager
();
int
requestId
=
corbaMsgMediator
.
getRequestId
();
bufferManager
.
cancelProcessing
(
requestId
);
}
}
catch
(
Exception
e
)
{
}
finally
{
// attempt to wake up waiting threads in all cases
call
.
inputObject
=
null
;
call
.
exception
=
systemException
;
call
.
done
.
notifyAll
();
}
}
call
.
inputObject
=
null
;
call
.
exception
=
systemException
;
call
.
done
.
notify
();
}
}
}
...
...
@@ -294,7 +309,7 @@ public class CorbaResponseWaitingRoomImpl
public
MessageMediator
getMessageMediator
(
int
requestId
)
{
Integer
id
=
new
Integer
(
requestId
);
OutCallDesc
call
=
(
OutCallDesc
)
out_calls
.
get
(
id
);
OutCallDesc
call
=
out_calls
.
get
(
id
);
if
(
call
==
null
)
{
// This can happen when getting early reply fragments for a
// request which has completed (e.g., client marshaling error).
...
...
src/share/classes/com/sun/corba/se/impl/transport/SocketOrChannelConnectionImpl.java
浏览文件 @
f2f1930e
/*
* Copyright (c) 2001, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -1521,7 +1521,7 @@ public class SocketOrChannelConnectionImpl
// connection and give them the SystemException;
responseWaitingRoom
.
signalExceptionToAllWaiters
(
systemException
);
}
finally
{
if
(
contactInfo
!=
null
)
{
((
OutboundConnectionCache
)
getConnectionCache
()).
remove
(
contactInfo
);
}
else
if
(
acceptor
!=
null
)
{
...
...
@@ -1542,7 +1542,6 @@ public class SocketOrChannelConnectionImpl
writeUnlock
();
}
finally
{
if
(
orb
.
transportDebugFlag
)
{
dprint
(
".purgeCalls<-: "
+
minor_code
+
"/"
+
die
+
"/"
+
lockHeld
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录