Skip to content

Commit

Permalink
netty -> 4.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
夜色 committed Jan 23, 2017
1 parent f100892 commit 959a3a9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void channelActive(ChannelHandlerContext ctx) throws Exception {

for (int i = 0; i < 3; i++) {
if (clientConfig != null) break;
clientConfig = ctx.channel().attr(CONFIG_KEY).getAndRemove();
clientConfig = ctx.channel().attr(CONFIG_KEY).getAndSet(null);
if (clientConfig == null) TimeUnit.SECONDS.sleep(1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public HttpClientHandler(NettyHttpClient client) {

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
RequestContext context = ctx.channel().attr(client.requestKey).getAndRemove();
RequestContext context = ctx.channel().attr(client.requestKey).getAndSet(null);
try {
if (context != null && context.tryDone()) {
context.onException(cause);
Expand All @@ -37,7 +37,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E

@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
RequestContext context = ctx.channel().attr(client.requestKey).getAndRemove();
RequestContext context = ctx.channel().attr(client.requestKey).getAndSet(null);
try {
if (context != null && context.tryDone()) {
LOGGER.debug("receive server response, request={}, response={}", context, msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public synchronized Channel tryAcquire(String host) {
}

public synchronized void tryRelease(Channel channel) {
String host = channel.attr(hostKey).getAndRemove();
String host = channel.attr(hostKey).getAndSet(null);
List<Channel> channels = channelPool.get(host);
if (channels == null || channels.size() < maxConnPerHost) {
LOGGER.debug("tryRelease channel success, host={}", host);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void writeRequest(Channel channel, RequestContext context) {
pool.attachHost(context.host, channel);
channel.writeAndFlush(context.request).addListener((ChannelFutureListener) future -> {
if (!future.isSuccess()) {
RequestContext info = future.channel().attr(requestKey).getAndRemove();
RequestContext info = future.channel().attr(requestKey).getAndSet(null);
info.tryDone();
info.onFailure(503, "Service Unavailable");
LOGGER.debug("request failure request={}", info);
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<mpush-boot-version>${mpush.version}</mpush-boot-version>
<mpush-test-version>${mpush.version}</mpush-test-version>
<mpush-zk-version>${mpush.version}</mpush-zk-version>
<netty.version>4.1.4.Final</netty.version>
<netty.version>4.1.7.Final</netty.version>
<os.detected.classifier>linux-x86_64</os.detected.classifier>
<org.mapstruct.version>1.1.0.Final</org.mapstruct.version>
</properties>
Expand Down Expand Up @@ -184,17 +184,17 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.21</version>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
<version>1.1.8</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
Expand Down Expand Up @@ -228,7 +228,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>21.0</version>
</dependency>
<!-- json lib -->
<dependency>
Expand Down

0 comments on commit 959a3a9

Please sign in to comment.