File tree 2 files changed +11
-4
lines changed
instrumentation/pekko/pekko-http-1.0/javaagent
src/main/java/io/opentelemetry/javaagent/instrumentation/pekkohttp/v1_0/server/route
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,9 @@ dependencies {
36
36
testInstrumentation(project(" :instrumentation:pekko:pekko-actor-1.0:javaagent" ))
37
37
testInstrumentation(project(" :instrumentation:executors:javaagent" ))
38
38
39
- latestDepTestLibrary(" org.apache.pekko:pekko-http_2.13:+" )
40
- latestDepTestLibrary(" org.apache.pekko:pekko-stream_2.13:+" )
39
+ latestDepTestLibrary(" org.apache.pekko:pekko-http_2.13:latest.release" )
40
+ latestDepTestLibrary(" org.apache.pekko:pekko-stream_2.13:latest.release" )
41
+ latestDepTestLibrary(" com.softwaremill.sttp.tapir:tapir-pekko-http-server_2.13:latest.release" )
41
42
}
42
43
43
44
tasks {
@@ -58,6 +59,7 @@ if (findProperty("testLatestDeps") as Boolean) {
58
59
testImplementation {
59
60
exclude(" org.apache.pekko" , " pekko-http_2.12" )
60
61
exclude(" org.apache.pekko" , " pekko-stream_2.12" )
62
+ exclude(" com.softwaremill.sttp.tapir" , " tapir-pekko-http-server_2.12" )
61
63
}
62
64
}
63
65
}
Original file line number Diff line number Diff line change @@ -44,8 +44,13 @@ public static void onEnter() {
44
44
@ Advice .OnMethodExit (onThrowable = Throwable .class , suppress = Throwable .class )
45
45
public static void onExit (
46
46
@ Advice .Argument (value = 2 ) RequestContext ctx ,
47
- @ Advice .Return (readOnly = false ) Future <RouteResult > fut ) {
48
- fut = fut .andThen (new RestoreOnExit (), ctx .executionContext ());
47
+ @ Advice .Return (readOnly = false ) Future <RouteResult > future ,
48
+ @ Advice .Thrown Throwable throwable ) {
49
+ if (throwable != null ) {
50
+ PekkoRouteHolder .restore ();
51
+ } else {
52
+ future = future .andThen (new RestoreOnExit (), ctx .executionContext ());
53
+ }
49
54
}
50
55
}
51
56
You can’t perform that action at this time.
0 commit comments