Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Madan Jampani
2014-10-28 08:40:23 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
15cd0b8fd3a2a3b4f02955aa42c9f08e1be3940f
15cd0b8f
1 parent
e0f804aa
Netty bug fix: Do not use weakValues in a cache where we track outstanding responses.
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
tools/dev/bash_profile
utils/netty/src/main/java/org/onlab/netty/Endpoint.java
utils/netty/src/main/java/org/onlab/netty/InternalMessage.java
utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
tools/dev/bash_profile
View file @
15cd0b8
...
...
@@ -8,7 +8,7 @@ export ONOS_ROOT=${ONOS_ROOT:-~/onos-next}
# Setup some environmental context for developers
if
[
-z
"
${
JAVA_HOME
}
"
]
;
then
if
[
-x /usr/libexec/java_home
]
;
then
export
JAVA_HOME
=
$(
/usr/libexec/java_home -v 1.
7
)
export
JAVA_HOME
=
$(
/usr/libexec/java_home -v 1.
8
)
elif
[
-d /usr/lib/jvm/java-7-openjdk-amd64
]
;
then
export
JAVA_HOME
=
"/usr/lib/jvm/java-7-openjdk-amd64"
fi
...
...
utils/netty/src/main/java/org/onlab/netty/Endpoint.java
View file @
15cd0b8
...
...
@@ -55,8 +55,8 @@ public class Endpoint {
@Override
public
String
toString
()
{
return
MoreObjects
.
toStringHelper
(
getClass
())
.
add
(
"port"
,
port
)
.
add
(
"host"
,
host
)
.
add
(
"port"
,
port
)
.
toString
();
}
...
...
utils/netty/src/main/java/org/onlab/netty/InternalMessage.java
View file @
15cd0b8
...
...
@@ -26,7 +26,7 @@ import java.io.IOException;
*/
public
final
class
InternalMessage
implements
Message
{
public
static
final
String
REPLY_MESSAGE_TYPE
=
"NETTY_MESSAGIG_REQUEST_REPLY"
;
public
static
final
String
REPLY_MESSAGE_TYPE
=
"NETTY_MESSAGI
N
G_REQUEST_REPLY"
;
private
long
id
;
private
Endpoint
sender
;
...
...
utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
View file @
15cd0b8
...
...
@@ -67,7 +67,6 @@ public class NettyMessagingService implements MessagingService {
private
final
AtomicLong
messageIdGenerator
=
new
AtomicLong
(
0
);
private
final
Cache
<
Long
,
SettableFuture
<
byte
[]>>
responseFutures
=
CacheBuilder
.
newBuilder
()
.
maximumSize
(
100000
)
.
weakValues
()
// TODO: Once the entry expires, notify blocking threads (if any).
.
expireAfterWrite
(
10
,
TimeUnit
.
MINUTES
)
.
build
();
...
...
@@ -174,7 +173,12 @@ public class NettyMessagingService implements MessagingService {
.
withType
(
type
)
.
withPayload
(
payload
)
.
build
();
sendAsync
(
ep
,
message
);
try
{
sendAsync
(
ep
,
message
);
}
catch
(
IOException
e
)
{
responseFutures
.
invalidate
(
messageId
);
throw
e
;
}
return
futureResponse
;
}
...
...
@@ -293,7 +297,8 @@ public class NettyMessagingService implements MessagingService {
if
(
futureResponse
!=
null
)
{
futureResponse
.
set
(
message
.
payload
());
}
else
{
log
.
warn
(
"Received a reply. But was unable to locate the request handle"
);
log
.
warn
(
"Received a reply for message id:[{}]. "
+
"But was unable to locate the request handle"
,
message
.
id
());
}
}
finally
{
NettyMessagingService
.
this
.
responseFutures
.
invalidate
(
message
.
id
());
...
...
Please
register
or
login
to post a comment