Skip to content

Commit

Permalink
Merge pull request #1669 from daneshk/master
Browse files Browse the repository at this point in the history
Remove thread local message frame to fix the connection close issue
  • Loading branch information
daneshk authored Dec 5, 2024
2 parents 39d43d2 + 50d78e8 commit 8b8deee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
Empty file.
41 changes: 22 additions & 19 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.10.0-20241025-103700-5c9e6a27"
distribution-version = "2201.11.0-20241121-075100-c4c87cbc"

[[package]]
org = "ballerina"
name = "auth"
version = "2.12.1"
version = "2.13.0"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -25,25 +25,26 @@ modules = [
[[package]]
org = "ballerina"
name = "cache"
version = "3.8.1"
version = "3.9.0"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "task"}
{org = "ballerina", name = "task"},
{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.1"
version = "1.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.3"
version = "2.8.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -65,7 +66,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "file"
version = "1.10.1"
version = "1.11.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand Down Expand Up @@ -137,7 +138,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.2"
version = "1.7.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand All @@ -154,15 +155,16 @@ modules = [
[[package]]
org = "ballerina"
name = "jwt"
version = "2.13.1"
version = "2.14.0"
dependencies = [
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.int"},
{org = "ballerina", name = "lang.string"},
{org = "ballerina", name = "log"}
{org = "ballerina", name = "log"},
{org = "ballerina", name = "time"}
]
modules = [
{org = "ballerina", packageName = "jwt", moduleName = "jwt"}
Expand Down Expand Up @@ -258,7 +260,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.10.1"
version = "2.11.0"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -272,7 +274,7 @@ modules = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.10.1"
version = "2.11.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -284,12 +286,13 @@ dependencies = [
[[package]]
org = "ballerina"
name = "oauth2"
version = "2.12.1"
version = "2.13.0"
dependencies = [
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "time"},
{org = "ballerina", name = "url"}
]
modules = [
Expand All @@ -299,15 +302,15 @@ modules = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.3.1"
version = "1.4.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "os"
version = "1.8.1"
version = "1.9.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -317,7 +320,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "protobuf"
version = "1.6.2"
version = "1.7.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -335,7 +338,7 @@ modules = [
[[package]]
org = "ballerina"
name = "task"
version = "2.5.1"
version = "2.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -358,7 +361,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.5.1"
version = "2.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -369,7 +372,7 @@ modules = [
[[package]]
org = "ballerina"
name = "url"
version = "2.4.1"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public class OutboundMessage {
private final HttpCarbonMessage responseMessage;
private int statusCode = NULL_STATUS_CODE;
private boolean outboundClosed;
private final ThreadLocal<MessageFramer> framer;
private final MessageFramer framer;

public OutboundMessage(HttpCarbonMessage responseMessage) {
this.responseMessage = responseMessage;
this.framer = ThreadLocal.withInitial(() -> new MessageFramer(responseMessage));
this.framer = new MessageFramer(responseMessage);
}

OutboundMessage(InboundMessage inboundMessage) {
Expand All @@ -68,7 +68,7 @@ public OutboundMessage(HttpCarbonMessage responseMessage) {
responseMessage.setHeader(CONTENT_TYPE_KEY, GrpcConstants.CONTENT_TYPE_GRPC);
responseMessage.setHeader(TE_KEY, GrpcConstants.TE_TRAILERS);
this.responseMessage = responseMessage;
this.framer = ThreadLocal.withInitial(() -> new MessageFramer(responseMessage));
this.framer = new MessageFramer(responseMessage);
}

/**
Expand Down Expand Up @@ -237,7 +237,7 @@ final void halfClose() {
}

final MessageFramer framer() {
return framer.get();
return framer;
}

public boolean isReady() {
Expand Down

0 comments on commit 8b8deee

Please sign in to comment.