Skip to content

Commit

Permalink
Merge branch 'metrics-logs' into java21
Browse files Browse the repository at this point in the history
  • Loading branch information
NipunaMadhushan authored Dec 20, 2024
2 parents e7d3ad3 + be9da2c commit 51eae4e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
org = "ballerinai"
name = "observe"
version = "1.3.0"
distribution = "2201.10.0"
version = "1.4.0"
distribution = "2201.11.0"

[platform.java21]
graalvmCompatible = true

[[platform.java21.dependency]]
path = "../native/build/libs/observe-internal-native-1.3.0.jar"
path = "../native/build/libs/observe-internal-native-1.4.0-SNAPSHOT.jar"
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
org = "ballerinai"
name = "observe"
version = "@toml.version@"
distribution = "2201.10.0"
distribution = "2201.11.0"

[platform.java21]
graalvmCompatible = true
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

org.gradle.caching=true
group=io.ballerina
version=1.3.1-SNAPSHOT
version=1.4.0-SNAPSHOT

ballerinaLangVersion=2201.11.0-20241219-143200-53f6d83e
githubSpotbugsVersion=6.0.18
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,18 @@ protected void channelRead0(ChannelHandlerContext ctx, Object o) {
properties.put(ObservabilityConstants.KEY_OBSERVER_CONTEXT, observerContext);
Utils.logInfo("Dispatching resource " + resourcePath);
ObjectType objectType = (ObjectType) serviceObject.getOriginalType();
try {
boolean isConcurrentSafe = objectType.isIsolated() && objectType.isIsolated(resourceFunctionName);
StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, properties);
Object result = env.getRuntime().callMethod(serviceObject, resourceFunctionName, metadata, args);
handleResult(ctx, result, resourcePath);
} catch (BError error) {
handleError(ctx, error, resourcePath);
} catch (Throwable cause) {
handleError(ctx, ErrorCreator.createError(cause), resourcePath);
}
Thread.startVirtualThread(() -> {
try {
boolean isConcurrentSafe = objectType.isIsolated() && objectType.isIsolated(resourceFunctionName);
StrandMetadata metadata = new StrandMetadata(isConcurrentSafe, properties);
Object result = env.getRuntime().callMethod(serviceObject, resourceFunctionName, metadata, args);
handleResult(ctx, result, resourcePath);
} catch (BError error) {
handleError(ctx, error, resourcePath);
} catch (Throwable cause) {
handleError(ctx, ErrorCreator.createError(cause), resourcePath);
}
});
}

@Override
Expand Down

0 comments on commit 51eae4e

Please sign in to comment.