From f6a2e3c98880ddce80817dfbf170abcc635192f7 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Thu, 17 Oct 2024 20:03:55 +0000 Subject: [PATCH 01/19] Update route_guide_bidirectional_streaming test results on Thu Oct 17 20:03:55 UTC 2024 --- .../route_guide_bidirectional_streaming/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_bidirectional_streaming/results/summary.csv b/load-tests/route_guide_bidirectional_streaming/results/summary.csv index ea5c02508..fa0b2e7aa 100644 --- a/load-tests/route_guide_bidirectional_streaming/results/summary.csv +++ b/load-tests/route_guide_bidirectional_streaming/results/summary.csv @@ -575,3 +575,4 @@ gRPC Route Guide Bidirectional Streaming,3506,482.530775,479.591677,0.0,748.5674 gRPC Route Guide Bidirectional Streaming,3345,505.135709,502.420856,0.0,798.854974,0.0,165.343025,1039.034575,0.0,1.86,0,0,1727460701,0,10 gRPC Route Guide Bidirectional Streaming,3314,510.11138,501.833977,0.0,802.72178,0.0,149.377058,1466.109361,0.0,1.84,0,0,1727547032,0,10 gRPC Route Guide Bidirectional Streaming,3530,481.633746,485.867694,0.0,766.209934,0.0,157.652587,1175.187999,0.0,1.96,0,0,1729102459,0,10 +gRPC Route Guide Bidirectional Streaming,3268,514.845909,512.637627,0.0,808.647631,0.0,131.481928,1307.470988,0.0,1.82,0,0,1729188763,0,10 From 06551d8b14bc8109fbfcf5ae83aeba29ab096f61 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Thu, 17 Oct 2024 20:03:55 +0000 Subject: [PATCH 02/19] Update route_guide_client_streaming test results on Thu Oct 17 20:03:55 UTC 2024 --- load-tests/route_guide_client_streaming/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_client_streaming/results/summary.csv b/load-tests/route_guide_client_streaming/results/summary.csv index 347208c58..ed77eb08b 100644 --- a/load-tests/route_guide_client_streaming/results/summary.csv +++ b/load-tests/route_guide_client_streaming/results/summary.csv @@ -579,3 +579,4 @@ gRPC Route Guide Client Streaming,898997,1.400038,0.92562,0.0,1.891121,0.0,0.689 gRPC Route Guide Client Streaming,898994,1.441502,0.907615,0.0,2.142536,0.0,0.734512,197.075894,0.0,499.44,0,0,1727462786,0,10 gRPC Route Guide Client Streaming,898997,1.457238,0.914714,0.0,2.213433,0.0,0.728111,196.229934,0.0,499.44,0,0,1727549118,0,10 gRPC Route Guide Client Streaming,898997,1.253074,0.818204,0.0,1.829809,0.0,0.637603,382.899362,0.0,499.44,0,0,1729104567,0,10 +gRPC Route Guide Client Streaming,898998,1.647377,1.016311,0.0,2.835227,0.0,0.781205,203.05984,0.0,499.44,0,0,1729190815,0,10 From 6de52d29a78f829f01c2552a017bffbbb2036581 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Thu, 17 Oct 2024 20:03:55 +0000 Subject: [PATCH 03/19] Update route_guide_server_streaming test results on Thu Oct 17 20:03:55 UTC 2024 --- load-tests/route_guide_server_streaming/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_server_streaming/results/summary.csv b/load-tests/route_guide_server_streaming/results/summary.csv index 041a653eb..f12f3ddf4 100644 --- a/load-tests/route_guide_server_streaming/results/summary.csv +++ b/load-tests/route_guide_server_streaming/results/summary.csv @@ -579,3 +579,4 @@ gRPC Route Guide Server Streaming,898998,5.987615,2.046317,0.0,18.504627,0.0,1.2 gRPC Route Guide Server Streaming,898996,8.16116,2.461642,0.0,48.984807,0.0,1.345322,210.027336,0.0,499.44,0,0,1727465663,0,10 gRPC Route Guide Server Streaming,898997,8.74801,2.659339,0.0,51.029056,0.0,1.35652,139.436291,0.0,499.44,0,0,1727552059,0,10 gRPC Route Guide Server Streaming,898994,4.752683,1.799709,0.0,13.739662,0.0,1.250806,180.150065,0.0,499.44,0,0,1729107184,0,10 +gRPC Route Guide Server Streaming,898998,13.869668,8.71621,0.0,54.957258,0.0,1.407411,196.414035,0.0,499.44,0,0,1729193305,0,10 From 1cf87112c65f37273ce3142024dc276cd335453f Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Thu, 17 Oct 2024 20:03:56 +0000 Subject: [PATCH 04/19] Update route_guide_unary test results on Thu Oct 17 20:03:56 UTC 2024 --- load-tests/route_guide_unary/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_unary/results/summary.csv b/load-tests/route_guide_unary/results/summary.csv index eaf51b9fc..29cdbda28 100644 --- a/load-tests/route_guide_unary/results/summary.csv +++ b/load-tests/route_guide_unary/results/summary.csv @@ -585,3 +585,4 @@ gRPC Route Guide Unary,898997,0.941409,0.715309,0.0,1.479118,0.0,0.509905,90.208 gRPC Route Guide Unary,898996,0.847067,0.675708,0.0,1.167135,0.0,0.472604,90.204033,0.0,499.44,0,0,1726085410,0,10 gRPC Route Guide Unary,898996,0.871588,0.67851,0.0,1.141717,0.0,0.504407,94.7139,0.0,499.44,0,0,1727554142,0,10 gRPC Route Guide Unary,898995,0.734134,0.599803,0.0,0.874304,0.0,0.432902,83.262678,0.0,499.44,0,0,1729109238,0,10 +gRPC Route Guide Unary,898999,0.976462,0.747409,0.0,1.259314,0.0,0.540303,100.586353,0.0,499.44,0,0,1729195393,0,10 From 23268688a14debf22aa2e040ad5c887b225eb362 Mon Sep 17 00:00:00 2001 From: Sumudu Nissanka Date: Wed, 6 Nov 2024 13:20:24 +0530 Subject: [PATCH 05/19] Update gradle.properties --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2b37bab26..dab089539 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=1.12.2-SNAPSHOT #dependency versions -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.11.0-20241008-112400-81975006 ballerinaTomlParserVersion=1.2.2 checkstylePluginVersion=10.12.0 commonsLang3Version=3.8.1 @@ -47,7 +47,7 @@ stdlibAuthVersion=2.12.0 stdlibJwtVersion=2.13.0 stdlibOAuth2Version=2.12.0 -stdlibHttpVersion=2.12.0 +stdlibHttpVersion=2.13.0-20241106-120000-d375c3b # Ballerinax Observer observeVersion=1.3.0 From ec6027efa5c44b7d6fa663eb3872e95ba000c406 Mon Sep 17 00:00:00 2001 From: Sumudu Nissanka Date: Wed, 6 Nov 2024 16:40:13 +0530 Subject: [PATCH 06/19] Update gradle.properties --- gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle.properties b/gradle.properties index dab089539..32cda71a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -44,6 +44,7 @@ stdlibMimeVersion=2.10.0 stdlibUuidVersion=1.8.0 stdlibAuthVersion=2.12.0 +stdlibDataJsonDataVersion = 0.3.0-20241105-101100-661d11f stdlibJwtVersion=2.13.0 stdlibOAuth2Version=2.12.0 From bde3ddea75614c656c6c4147b0d4423ac05ada6b Mon Sep 17 00:00:00 2001 From: Sumudu Nissanka Date: Wed, 6 Nov 2024 16:54:26 +0530 Subject: [PATCH 07/19] Update build.gradle --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index f582d3cff..3b9153846 100644 --- a/build.gradle +++ b/build.gradle @@ -92,6 +92,7 @@ subprojects { ballerinaStdLibs "io.ballerina.stdlib:random-ballerina:${stdlibRandomVersion}" ballerinaStdLibs "io.ballerina.stdlib:observe-ballerina:${observeVersion}" ballerinaStdLibs "io.ballerina:observe-ballerina:${observeInternalVersion}" + ballerinaStdLibs "io.ballerina.lib:data.jsondata-ballerina:${stdlibDataJsonDataVersion}" } } From 252a2b83ff2a9654bda87302f66ad4c7d23b866c Mon Sep 17 00:00:00 2001 From: Sumudu Nissanka Date: Wed, 6 Nov 2024 16:54:59 +0530 Subject: [PATCH 08/19] Update Ballerina.toml --- build-config/resources/Ballerina.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index c11629927..26392e274 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -2,7 +2,7 @@ org = "ballerina" name = "grpc" version = "@toml.version@" -distribution = "2201.10.0" +distribution = "2201.11.0" authors = ["Ballerina"] keywords = ["network", "grpc", "protobuf", "server-streaming", "client-streaming", "bidirectional-streaming"] repository = "https://github.com/ballerina-platform/module-ballerina-grpc" From 088c0c847fb1fb240c8cf0c788f8f12dfe61a543 Mon Sep 17 00:00:00 2001 From: Sumudu Nissanka Date: Wed, 6 Nov 2024 20:19:04 +0530 Subject: [PATCH 09/19] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 32cda71a2..006ee3a12 100644 --- a/gradle.properties +++ b/gradle.properties @@ -44,7 +44,7 @@ stdlibMimeVersion=2.10.0 stdlibUuidVersion=1.8.0 stdlibAuthVersion=2.12.0 -stdlibDataJsonDataVersion = 0.3.0-20241105-101100-661d11f +stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f stdlibJwtVersion=2.13.0 stdlibOAuth2Version=2.12.0 From 396a655dd563c2bc9cebc5cae215910a8896ecf7 Mon Sep 17 00:00:00 2001 From: Sumudu Nissanka Date: Thu, 7 Nov 2024 13:23:41 +0530 Subject: [PATCH 10/19] Update gradle.properties for next minor version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 006ee3a12..a0289f900 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ org.gradle.caching=true group=io.ballerina.stdlib -version=1.12.2-SNAPSHOT +version=1.13.0-SNAPSHOT #dependency versions ballerinaLangVersion=2201.11.0-20241008-112400-81975006 ballerinaTomlParserVersion=1.2.2 From ea460b6e8c76294e4f23db7db2e5245bea0755ba Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 13 Nov 2024 16:03:36 +0530 Subject: [PATCH 11/19] Update dependency versions --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index a0289f900..5541c8949 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ slf4jVersion=1.7.30 protoGoogleCommonsVersion=1.17.0 protobufJavaVersion=3.25.5 jknackHandlebarsVersion=4.0.6 -nettyVersion=4.1.108.Final +nettyVersion=4.1.115.Final nettyTcnativeVersion=2.0.65.Final picocliVersion=4.0.1 githubSpotbugsVersion=5.0.14 @@ -48,7 +48,7 @@ stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f stdlibJwtVersion=2.13.0 stdlibOAuth2Version=2.12.0 -stdlibHttpVersion=2.13.0-20241106-120000-d375c3b +stdlibHttpVersion=2.13.0-20241113-151000-3feb04b # Ballerinax Observer observeVersion=1.3.0 From c85f5ed74987fc685a0a535b19b84ce6517d06c3 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 13 Nov 2024 16:05:05 +0530 Subject: [PATCH 12/19] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 64 +++++++++++++++++------------------ ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 21 +++++++++--- 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index d03fe7094..2880a96b1 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,8 +1,8 @@ [package] org = "ballerina" name = "grpc" -version = "1.12.1" -distribution = "2201.10.0" +version = "1.13.0" +distribution = "2201.11.0" authors = ["Ballerina"] keywords = ["network", "grpc", "protobuf", "server-streaming", "client-streaming", "bidirectional-streaming"] repository = "https://github.com/ballerina-platform/module-ballerina-grpc" @@ -16,15 +16,15 @@ graalvmCompatible = true [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "grpc-native" -version = "1.12.1" -path = "../native/build/libs/grpc-native-1.12.1.jar" +version = "1.13.0" +path = "../native/build/libs/grpc-native-1.13.0-SNAPSHOT.jar" [[platform.java17.dependency]] -path = "../test-utils/build/libs/grpc-test-utils-1.12.1.jar" +path = "../test-utils/build/libs/grpc-test-utils-1.13.0-SNAPSHOT.jar" scope = "testOnly" [[platform.java17.dependency]] -path = "./lib/ballerina-cli-2201.10.0.jar" +path = "./lib/ballerina-cli-2201.11.0-20241008-112400-81975006.jar" scope = "testOnly" [[platform.java17.dependency]] @@ -34,68 +34,68 @@ scope = "testOnly" [[platform.java17.dependency]] groupId = "io.ballerina.stdlib" artifactId = "http-native" -version = "2.12.0" -path = "./lib/http-native-2.12.0.jar" +version = "2.13.0" +path = "./lib/http-native-2.13.0-20241113-151000-3feb04b.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-common" -version = "4.1.108.Final" -path = "./lib/netty-common-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-common-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-buffer" -version = "4.1.108.Final" -path = "./lib/netty-buffer-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-buffer-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-transport" -version = "4.1.108.Final" -path = "./lib/netty-transport-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-transport-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-resolver" -version = "4.1.108.Final" -path = "./lib/netty-resolver-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-resolver-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-handler" -version = "4.1.108.Final" -path = "./lib/netty-handler-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-handler-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-codec-http" -version = "4.1.108.Final" -path = "./lib/netty-codec-http-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-codec-http-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-codec" -version = "4.1.108.Final" -path = "./lib/netty-codec-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-codec-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-handler-proxy" -version = "4.1.108.Final" -path = "./lib/netty-handler-proxy-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-handler-proxy-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-codec-http2" -version = "4.1.108.Final" -path = "./lib/netty-codec-http2-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-codec-http2-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-transport-native-unix-common" -version = "4.1.108.Final" -path = "./lib/netty-transport-native-unix-common-4.1.108.Final.jar" +version = "4.1.115.Final" +path = "./lib/netty-transport-native-unix-common-4.1.115.Final.jar" [[platform.java17.dependency]] groupId = "commons.pool.wso2" @@ -163,11 +163,11 @@ path = "./lib/proto-google-common-protos-1.17.0.jar" [[platform.java17.dependency]] groupId = "org.ballerinalang" artifactId = "formatter-core" -version = "2201.10.0" -path = "./lib/formatter-core-2201.10.0.jar" +version = "2201.11.0-20241008-112400-81975006" +path = "./lib/formatter-core-2201.11.0-20241008-112400-81975006.jar" [[platform.java17.dependency]] groupId = "org.ballerinalang" artifactId = "ballerina-parser" -version = "2201.10.0" -path = "./lib/ballerina-parser-2201.10.0.jar" +version = "2201.11.0-20241008-112400-81975006" +path = "./lib/ballerina-parser-2201.11.0-20241008-112400-81975006.jar" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 32560585a..886a7f4c6 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "grpc-compiler-plugin" class = "io.ballerina.stdlib.grpc.plugin.GrpcCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/grpc-compiler-plugin-1.12.1.jar" +path = "../compiler-plugin/build/libs/grpc-compiler-plugin-1.13.0-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 064d095a6..c37fdd60a 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.11.0-20241008-112400-81975006" [[package]] org = "ballerina" @@ -53,6 +53,16 @@ modules = [ {org = "ballerina", packageName = "crypto", moduleName = "crypto"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "0.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" @@ -68,7 +78,7 @@ dependencies = [ [[package]] org = "ballerina" name = "grpc" -version = "1.12.1" +version = "1.13.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "crypto"}, @@ -94,13 +104,14 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.12.0" +version = "2.13.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -263,7 +274,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -350,7 +361,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.4.0" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] From c42c6df12159bff4dfbf060ef6b60bd9fc5bb0c0 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 13 Nov 2024 16:17:42 +0530 Subject: [PATCH 13/19] Update changelog --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index 7912c1a47..7eae150a4 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,12 @@ This file contains all the notable changes done to the Ballerina gRPC package th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- [Address CVE-2024-47535 vulnerability](https://github.com/ballerina-platform/ballerina-library/issues/7358) + ## [1.12.1] - 2024-09-26 ### Fixed From d603c1ab00c70403159c7dc7f8743a61d9e63c28 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 13 Nov 2024 20:15:33 +0000 Subject: [PATCH 14/19] Update route_guide_bidirectional_streaming test results on Wed Nov 13 20:15:33 UTC 2024 --- .../route_guide_bidirectional_streaming/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_bidirectional_streaming/results/summary.csv b/load-tests/route_guide_bidirectional_streaming/results/summary.csv index fa0b2e7aa..902fada76 100644 --- a/load-tests/route_guide_bidirectional_streaming/results/summary.csv +++ b/load-tests/route_guide_bidirectional_streaming/results/summary.csv @@ -576,3 +576,4 @@ gRPC Route Guide Bidirectional Streaming,3345,505.135709,502.420856,0.0,798.8549 gRPC Route Guide Bidirectional Streaming,3314,510.11138,501.833977,0.0,802.72178,0.0,149.377058,1466.109361,0.0,1.84,0,0,1727547032,0,10 gRPC Route Guide Bidirectional Streaming,3530,481.633746,485.867694,0.0,766.209934,0.0,157.652587,1175.187999,0.0,1.96,0,0,1729102459,0,10 gRPC Route Guide Bidirectional Streaming,3268,514.845909,512.637627,0.0,808.647631,0.0,131.481928,1307.470988,0.0,1.82,0,0,1729188763,0,10 +gRPC Route Guide Bidirectional Streaming,3592,473.780663,476.37975,0.0,742.511928,0.0,152.013694,1023.708903,0.0,1.99,0,0,1731521579,0,10 From a642eee7fa8d76daa1c1cd6d762bf421f24bbb28 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 13 Nov 2024 20:15:34 +0000 Subject: [PATCH 15/19] Update route_guide_client_streaming test results on Wed Nov 13 20:15:34 UTC 2024 --- load-tests/route_guide_client_streaming/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_client_streaming/results/summary.csv b/load-tests/route_guide_client_streaming/results/summary.csv index ed77eb08b..145e5371f 100644 --- a/load-tests/route_guide_client_streaming/results/summary.csv +++ b/load-tests/route_guide_client_streaming/results/summary.csv @@ -580,3 +580,4 @@ gRPC Route Guide Client Streaming,898994,1.441502,0.907615,0.0,2.142536,0.0,0.73 gRPC Route Guide Client Streaming,898997,1.457238,0.914714,0.0,2.213433,0.0,0.728111,196.229934,0.0,499.44,0,0,1727549118,0,10 gRPC Route Guide Client Streaming,898997,1.253074,0.818204,0.0,1.829809,0.0,0.637603,382.899362,0.0,499.44,0,0,1729104567,0,10 gRPC Route Guide Client Streaming,898998,1.647377,1.016311,0.0,2.835227,0.0,0.781205,203.05984,0.0,499.44,0,0,1729190815,0,10 +gRPC Route Guide Client Streaming,899001,1.227053,0.808098,0.0,1.758296,0.0,0.631299,223.038223,0.0,499.44,0,0,1731523627,0,10 From 8a2607aa17123e2e593bbe7922c0e096cb224296 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 13 Nov 2024 20:15:34 +0000 Subject: [PATCH 16/19] Update route_guide_server_streaming test results on Wed Nov 13 20:15:34 UTC 2024 --- load-tests/route_guide_server_streaming/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_server_streaming/results/summary.csv b/load-tests/route_guide_server_streaming/results/summary.csv index f12f3ddf4..ed7f6fd35 100644 --- a/load-tests/route_guide_server_streaming/results/summary.csv +++ b/load-tests/route_guide_server_streaming/results/summary.csv @@ -580,3 +580,4 @@ gRPC Route Guide Server Streaming,898996,8.16116,2.461642,0.0,48.984807,0.0,1.34 gRPC Route Guide Server Streaming,898997,8.74801,2.659339,0.0,51.029056,0.0,1.35652,139.436291,0.0,499.44,0,0,1727552059,0,10 gRPC Route Guide Server Streaming,898994,4.752683,1.799709,0.0,13.739662,0.0,1.250806,180.150065,0.0,499.44,0,0,1729107184,0,10 gRPC Route Guide Server Streaming,898998,13.869668,8.71621,0.0,54.957258,0.0,1.407411,196.414035,0.0,499.44,0,0,1729193305,0,10 +gRPC Route Guide Server Streaming,898997,4.404741,1.739797,0.0,13.110902,0.0,1.237798,194.497726,0.0,499.44,0,0,1731526731,0,10 From 4e63107b9d27f80dd4047190de25e66d1def85e8 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Wed, 13 Nov 2024 20:15:34 +0000 Subject: [PATCH 17/19] Update route_guide_unary test results on Wed Nov 13 20:15:34 UTC 2024 --- load-tests/route_guide_unary/results/summary.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/load-tests/route_guide_unary/results/summary.csv b/load-tests/route_guide_unary/results/summary.csv index 29cdbda28..61f78fd46 100644 --- a/load-tests/route_guide_unary/results/summary.csv +++ b/load-tests/route_guide_unary/results/summary.csv @@ -586,3 +586,4 @@ gRPC Route Guide Unary,898996,0.847067,0.675708,0.0,1.167135,0.0,0.472604,90.204 gRPC Route Guide Unary,898996,0.871588,0.67851,0.0,1.141717,0.0,0.504407,94.7139,0.0,499.44,0,0,1727554142,0,10 gRPC Route Guide Unary,898995,0.734134,0.599803,0.0,0.874304,0.0,0.432902,83.262678,0.0,499.44,0,0,1729109238,0,10 gRPC Route Guide Unary,898999,0.976462,0.747409,0.0,1.259314,0.0,0.540303,100.586353,0.0,499.44,0,0,1729195393,0,10 +gRPC Route Guide Unary,898996,0.736169,0.596999,0.0,0.878098,0.0,0.4006,97.861689,0.0,499.44,0,0,1731528821,0,10 From cff32eb37077489fd572b9065c8cff82f2f1ab66 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Thu, 14 Nov 2024 19:08:30 +0530 Subject: [PATCH 18/19] Migrate to new Runtime APIs --- gradle.properties | 42 +++++++++---------- .../ballerina/stdlib/grpc/GrpcConstants.java | 9 +--- .../io/ballerina/stdlib/grpc/GrpcUtil.java | 2 +- .../io/ballerina/stdlib/grpc/Message.java | 4 +- .../ballerina/stdlib/grpc/MessageUtils.java | 4 +- .../stdlib/grpc/ServiceDefinition.java | 4 +- .../stdlib/grpc/ServicesBuilderUtils.java | 2 +- .../StreamingCallableUnitCallBack.java | 24 ++++------- .../callback/UnaryCallableUnitCallBack.java | 25 ++++------- .../grpc/listener/ServerCallHandler.java | 25 ++++------- .../listener/StreamingServerCallHandler.java | 12 ++---- .../serviceendpoint/FunctionUtils.java | 2 +- .../streamingclient/FunctionUtils.java | 2 +- .../io/ballerina/stdlib/grpc/stubs/Stub.java | 2 +- .../serviceendpoint/FunctionUtilsTest.java | 2 +- 15 files changed, 65 insertions(+), 96 deletions(-) diff --git a/gradle.properties b/gradle.properties index 96362b899..587219325 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=1.12.2-SNAPSHOT #dependency versions -ballerinaLangVersion=2201.10.0-20241025-103700-5c9e6a27 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 ballerinaTomlParserVersion=1.2.2 checkstylePluginVersion=10.12.0 commonsLang3Version=3.8.1 @@ -26,29 +26,29 @@ bouncycastleVersion=1.78 wso2CommonsPoolVersion=1.5.6.wso2v1 #stdlib dependencies -stdlibIoVersion=1.6.2-20240928-084100-656404f -stdlibTimeVersion=2.5.1-20240930-120200-e59222b -stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 +stdlibIoVersion=1.6.2-20241112-233100-995cf5f +stdlibTimeVersion=2.6.0-20241113-073800-201b904 +stdlibUrlVersion=2.4.1-20241113-073900-335ff51 -stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 -stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab -stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 -stdlibOsVersion=1.8.1-20241001-120600-dd1626e -stdlibProtobufVersion=1.6.2-20240930-192700-1e42210 -stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e -stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 +stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5 +stdlibCryptoVersion=2.7.3-20241113-081400-d015a39 +stdlibLogVersion=2.10.1-20241113-120000-4577868 +stdlibOsVersion=1.8.1-20241113-122000-cca973b +stdlibProtobufVersion=1.6.2-20241113-122200-13cac06 +stdlibRandomVersion=1.5.1-20241113-122300-1bc770e +stdlibTaskVersion=2.5.1-20241113-123500-f905281 -stdlibCacheVersion=3.8.1-20241007-154900-63f4403 -stdlibFileVersion=1.10.1-20241007-160900-03f7b64 -stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 -stdlibUuidVersion=1.8.1-20241009-134600-a05012b +stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf +stdlibFileVersion=1.10.1-20241113-151700-e1a2e38 +stdlibMimeVersion=2.10.2-20241113-154200-d953747 +stdlibUuidVersion=1.8.1-20241113-154400-443c67b -stdlibAuthVersion=2.12.1-20241010-130800-733dbef -stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 -stdlibOAuth2Version=2.12.1-20241029-084800-d7ba9e5 +stdlibAuthVersion=2.12.1-20241113-162300-ded40eb +stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa +stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe -stdlibHttpVersion=2.13.0-20241029-110700-30ed05b +stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a # Ballerinax Observer -observeVersion=1.3.1-20241007-161000-645452d -observeInternalVersion=1.3.1-20241007-182700-a5f77a1 +observeVersion=1.4.0-20241113-092000-b83ae74 +observeInternalVersion=1.3.1-20241113-101700-265054d diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/GrpcConstants.java b/native/src/main/java/io/ballerina/stdlib/grpc/GrpcConstants.java index abf8f2858..f7f113261 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/GrpcConstants.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/GrpcConstants.java @@ -16,7 +16,6 @@ package io.ballerina.stdlib.grpc; import com.google.protobuf.DescriptorProtos; -import io.ballerina.runtime.api.async.StrandMetadata; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BString; @@ -25,7 +24,6 @@ import java.util.Map; import java.util.Objects; -import static io.ballerina.runtime.api.constants.RuntimeConstants.BALLERINA_BUILTIN_PKG_PREFIX; import static io.ballerina.runtime.api.constants.RuntimeConstants.ORG_NAME_SEPARATOR; import static io.ballerina.stdlib.grpc.nativeimpl.ModuleUtils.getModule; @@ -37,7 +35,7 @@ public class GrpcConstants { //gRPC package name. public static final String PROTOCOL_PACKAGE_GRPC = "grpc"; - public static final String PROTOCOL_PACKAGE_VERSION_GRPC = getModule().getVersion(); + public static final String PROTOCOL_PACKAGE_VERSION_GRPC = getModule().getMajorVersion(); public static final String ORG_NAME = "ballerina"; public static final String PROTOCOL_STRUCT_PACKAGE_GRPC = ORG_NAME + ORG_NAME_SEPARATOR + "grpc:" + PROTOCOL_PACKAGE_VERSION_GRPC; @@ -240,11 +238,6 @@ public static T getKeyByValue(Map map, E value) { //Observability tag keys public static final String TAG_KEY_GRPC_ERROR_MESSAGE = "grpc.error_message"; - // Strand meta data - public static final StrandMetadata ON_MESSAGE_METADATA = - new StrandMetadata(BALLERINA_BUILTIN_PKG_PREFIX, PROTOCOL_PACKAGE_GRPC, PROTOCOL_PACKAGE_VERSION_GRPC, - ON_MESSAGE_RESOURCE); - public static final BString ENDPOINT_CONFIG_SECURESOCKET = StringUtils.fromString("secureSocket"); public static final BString SECURESOCKET_CONFIG_DISABLE_SSL = StringUtils.fromString("enable"); public static final BString SECURESOCKET_CONFIG_CERT = StringUtils.fromString("cert"); diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/GrpcUtil.java b/native/src/main/java/io/ballerina/stdlib/grpc/GrpcUtil.java index 45225a573..accf77f51 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/GrpcUtil.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/GrpcUtil.java @@ -18,9 +18,9 @@ package io.ballerina.stdlib.grpc; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BDecimal; import io.ballerina.runtime.api.values.BError; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/Message.java b/native/src/main/java/io/ballerina/stdlib/grpc/Message.java index 5ad937b10..8b8e84190 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/Message.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/Message.java @@ -28,16 +28,16 @@ import com.google.protobuf.TimestampProto; import com.google.protobuf.WireFormat; import com.google.protobuf.WrappersProto; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.AnydataType; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.MapType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.TupleType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.types.UnionType; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/MessageUtils.java b/native/src/main/java/io/ballerina/stdlib/grpc/MessageUtils.java index b6f1042ff..77583f135 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/MessageUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/MessageUtils.java @@ -17,15 +17,15 @@ import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.MethodType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/ServiceDefinition.java b/native/src/main/java/io/ballerina/stdlib/grpc/ServiceDefinition.java index 6d5da9e67..4fc452398 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/ServiceDefinition.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/ServiceDefinition.java @@ -21,15 +21,15 @@ import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors; import com.google.protobuf.InvalidProtocolBufferException; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.types.ErrorType; import io.ballerina.runtime.api.types.MethodType; import io.ballerina.runtime.api.types.NullType; import io.ballerina.runtime.api.types.ObjectType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.StreamType; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.types.UnionType; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BMap; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/ServicesBuilderUtils.java b/native/src/main/java/io/ballerina/stdlib/grpc/ServicesBuilderUtils.java index 0c9abfed1..e5887a3b5 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/ServicesBuilderUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/ServicesBuilderUtils.java @@ -22,7 +22,6 @@ import com.google.protobuf.Descriptors; import com.google.protobuf.InvalidProtocolBufferException; import io.ballerina.runtime.api.Module; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.Runtime; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; @@ -30,6 +29,7 @@ import io.ballerina.runtime.api.types.NullType; import io.ballerina.runtime.api.types.ObjectType; import io.ballerina.runtime.api.types.Parameter; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.RecordType; import io.ballerina.runtime.api.types.StreamType; import io.ballerina.runtime.api.types.Type; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/callback/StreamingCallableUnitCallBack.java b/native/src/main/java/io/ballerina/stdlib/grpc/callback/StreamingCallableUnitCallBack.java index b74265fb7..43c9bc02e 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/callback/StreamingCallableUnitCallBack.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/callback/StreamingCallableUnitCallBack.java @@ -19,6 +19,7 @@ import com.google.protobuf.Descriptors; import io.ballerina.runtime.api.Runtime; +import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.types.ObjectType; import io.ballerina.runtime.api.utils.StringUtils; @@ -110,13 +111,10 @@ public void notifySuccess(Object response) { ObjectType serviceObjectType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bObject)); Thread.startVirtualThread(() -> { try { - Object result; - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION)) { - result = runtime.startIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null).get(); - } else { - result = runtime.startNonIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null) - .get(); - } + boolean isConcurrentSafe = serviceObjectType.isIsolated() && + serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, null); + Object result = runtime.callMethod(bObject, STREAMING_NEXT_FUNCTION, metadata); returnStreamUnitCallBack.notifySuccess(result); } catch (BError error) { returnStreamUnitCallBack.notifyFailure(error); @@ -209,14 +207,10 @@ public void notifySuccess(Object response) { ObjectType serviceObjectType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bObject)); Thread.startVirtualThread(() -> { try { - Object result; - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION)) { - result = runtime.startIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null) - .get(); - } else { - result = runtime.startNonIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null) - .get(); - } + boolean isConcurrentSafe = serviceObjectType.isIsolated() && + serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, null); + Object result = runtime.callMethod(bObject, STREAMING_NEXT_FUNCTION, metadata); this.notifySuccess(result); } catch (BError error) { this.notifyFailure(error); diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/callback/UnaryCallableUnitCallBack.java b/native/src/main/java/io/ballerina/stdlib/grpc/callback/UnaryCallableUnitCallBack.java index 637673645..aba640409 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/callback/UnaryCallableUnitCallBack.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/callback/UnaryCallableUnitCallBack.java @@ -19,6 +19,7 @@ import com.google.protobuf.Descriptors; import io.ballerina.runtime.api.Runtime; +import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.types.ObjectType; import io.ballerina.runtime.api.utils.StringUtils; @@ -119,14 +120,10 @@ public void notifySuccess(Object response) { ObjectType serviceObjectType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bObject)); Thread.startVirtualThread(() -> { try { - Object result; - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION)) { - result = runtime.startIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null) - .get(); - } else { - result = runtime.startNonIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, - null).get(); - } + boolean isConcurrentSafe = serviceObjectType.isIsolated() && + serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, null); + Object result = runtime.callMethod(bObject, STREAMING_NEXT_FUNCTION, metadata); returnStreamUnitCallBack.notifySuccess(result); } catch (BError error) { returnStreamUnitCallBack.notifyFailure(error); @@ -222,14 +219,10 @@ public void notifySuccess(Object response) { ObjectType serviceObjectType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bObject)); Thread.startVirtualThread(() -> { try { - Object result; - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION)) { - result = runtime.startIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null) - .get(); - } else { - result = runtime.startNonIsolatedWorker(bObject, STREAMING_NEXT_FUNCTION, null, null, null) - .get(); - } + boolean isConcurrentSafe = serviceObjectType.isIsolated() && + serviceObjectType.isIsolated(STREAMING_NEXT_FUNCTION); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, null); + Object result = runtime.callMethod(bObject, STREAMING_NEXT_FUNCTION, metadata); this.notifySuccess(result); } catch (BError error) { this.notifyFailure(error); diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java b/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java index 940604478..238d1d968 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java @@ -18,12 +18,14 @@ package io.ballerina.stdlib.grpc.listener; import com.google.protobuf.Descriptors; -import io.ballerina.runtime.api.PredefinedTypes; -import io.ballerina.runtime.api.TypeTags; +import io.ballerina.runtime.api.Environment; +import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ArrayType; import io.ballerina.runtime.api.types.ObjectType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; @@ -190,23 +192,14 @@ void onMessageInvoke(ServiceResource resource, Message request, StreamObserver r Thread.startVirtualThread(() -> { try { boolean isEmpty = isEmpty(requestParams); + boolean isConcurrentSafe = serviceObjectType.isIsolated() && serviceObjectType.isIsolated(functionName); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, properties); Object result; if (isEmpty) { - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(functionName)) { - result = resource.getRuntime().startIsolatedWorker(resource.getService(), functionName, null, - GrpcConstants.ON_MESSAGE_METADATA, properties).get(); - } else { - result = resource.getRuntime().startNonIsolatedWorker(resource.getService(), functionName, null, - GrpcConstants.ON_MESSAGE_METADATA, properties).get(); - } + result = resource.getRuntime().callMethod(resource.getService(), functionName, metadata); } else { - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(functionName)) { - result = resource.getRuntime().startIsolatedWorker(resource.getService(), functionName, null, - GrpcConstants.ON_MESSAGE_METADATA, properties, requestParams).get(); - } else { - result = resource.getRuntime().startNonIsolatedWorker(resource.getService(), functionName, null, - GrpcConstants.ON_MESSAGE_METADATA, properties, requestParams).get(); - } + result = resource.getRuntime().callMethod(resource.getService(), functionName, metadata, + requestParams); } callback.notifySuccess(result); } catch (BError error) { diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/listener/StreamingServerCallHandler.java b/native/src/main/java/io/ballerina/stdlib/grpc/listener/StreamingServerCallHandler.java index f932c478e..76218f136 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/listener/StreamingServerCallHandler.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/listener/StreamingServerCallHandler.java @@ -19,6 +19,7 @@ package io.ballerina.stdlib.grpc.listener; import com.google.protobuf.Descriptors; +import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ObjectType; @@ -190,14 +191,9 @@ void onStreamInvoke(ServiceResource resource, BStream requestStream, HttpHeaders ObjectType serviceObjectType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(service)); Thread.startVirtualThread(() -> { try { - Object result; - if (serviceObjectType.isIsolated() && serviceObjectType.isIsolated(functionName)) { - result = resource.getRuntime().startIsolatedWorker(service, functionName, null, - GrpcConstants.ON_MESSAGE_METADATA, properties, requestParams).get(); - } else { - result = resource.getRuntime().startNonIsolatedWorker(service, functionName, null, - GrpcConstants.ON_MESSAGE_METADATA, properties, requestParams).get(); - } + boolean isConcurrentSafe = serviceObjectType.isIsolated() && serviceObjectType.isIsolated(functionName); + StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, properties); + Object result = resource.getRuntime().callMethod(service, functionName, metadata, requestParams); callback.notifySuccess(result); } catch (BError error) { callback.notifyFailure(error); diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtils.java b/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtils.java index 241ed4af0..6ac0a4f99 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtils.java @@ -20,10 +20,10 @@ import com.google.protobuf.Descriptors; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ObjectType; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/streamingclient/FunctionUtils.java b/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/streamingclient/FunctionUtils.java index d82af0c16..2d2a68e1b 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/streamingclient/FunctionUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/nativeimpl/streamingclient/FunctionUtils.java @@ -20,9 +20,9 @@ import com.google.protobuf.Descriptors; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BError; import io.ballerina.runtime.api.values.BMap; diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/stubs/Stub.java b/native/src/main/java/io/ballerina/stdlib/grpc/stubs/Stub.java index 879c59a90..1bb7d753c 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/stubs/Stub.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/stubs/Stub.java @@ -17,9 +17,9 @@ */ package io.ballerina.stdlib.grpc.stubs; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.Type; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BError; diff --git a/native/src/test/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtilsTest.java b/native/src/test/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtilsTest.java index 07a8d26d1..f4a138ec1 100644 --- a/native/src/test/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtilsTest.java +++ b/native/src/test/java/io/ballerina/stdlib/grpc/nativeimpl/serviceendpoint/FunctionUtilsTest.java @@ -20,9 +20,9 @@ import com.google.protobuf.DescriptorProtos; import com.google.protobuf.Descriptors; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BMap; From 29d54201406adc0a2ff216675c15c28f16079447 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Thu, 14 Nov 2024 19:24:35 +0530 Subject: [PATCH 19/19] Fix checkstyle errors --- gradle.properties | 1 + .../io/ballerina/stdlib/grpc/listener/ServerCallHandler.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6ecd07dea..bbe1a4e9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -44,6 +44,7 @@ stdlibMimeVersion=2.10.2-20241113-154200-d953747 stdlibUuidVersion=1.8.1-20241113-154400-443c67b stdlibAuthVersion=2.12.1-20241113-162300-ded40eb +stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739 stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java b/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java index 238d1d968..41f059e56 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/listener/ServerCallHandler.java @@ -18,7 +18,6 @@ package io.ballerina.stdlib.grpc.listener; import com.google.protobuf.Descriptors; -import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.ArrayType;