@@ -174,7 +174,7 @@ public void writeReadState() throws Exception {
174
174
public void stateTTL (AppRun .AppProtocol serviceAppProtocol ) throws Exception {
175
175
logger .debug ("Starting actor runtime ..." );
176
176
// The call below will fail if service cannot start successfully.
177
- DaprRun runtime = startDaprApp (
177
+ DaprRun run = startDaprApp (
178
178
this .getClass ().getSimpleName (),
179
179
StatefulActorService .SUCCESS_MESSAGE ,
180
180
StatefulActorService .class ,
@@ -190,7 +190,7 @@ public void stateTTL(AppRun.AppProtocol serviceAppProtocol) throws Exception {
190
190
String actorType = "StatefulActorTest" ;
191
191
logger .debug ("Building proxy ..." );
192
192
ActorProxyBuilder <ActorProxy > proxyBuilder =
193
- new ActorProxyBuilder (actorType , ActorProxy .class , newActorClient ());
193
+ new ActorProxyBuilder (actorType , ActorProxy .class , deferClose ( run . newActorClient ());
194
194
ActorProxy proxy = proxyBuilder .build (actorId );
195
195
196
196
// wating for actor to be activated
@@ -231,7 +231,7 @@ public void stateTTL(AppRun.AppProtocol serviceAppProtocol) throws Exception {
231
231
serviceAppProtocol );
232
232
233
233
// Need new proxy builder because the proxy builder holds the channel.
234
- proxyBuilder = new ActorProxyBuilder (actorType , ActorProxy .class , newActorClient ());
234
+ proxyBuilder = new ActorProxyBuilder (actorType , ActorProxy .class , deferClose ( run2 . newActorClient ());
235
235
ActorProxy newProxy = proxyBuilder .build (actorId );
236
236
237
237
// waiting for actor to be activated
0 commit comments