@@ -174,7 +174,7 @@ public void writeReadState() throws Exception {
174174 public void stateTTL (AppRun .AppProtocol serviceAppProtocol ) throws Exception {
175175 logger .debug ("Starting actor runtime ..." );
176176 // The call below will fail if service cannot start successfully.
177- DaprRun runtime = startDaprApp (
177+ DaprRun run = startDaprApp (
178178 this .getClass ().getSimpleName (),
179179 StatefulActorService .SUCCESS_MESSAGE ,
180180 StatefulActorService .class ,
@@ -190,7 +190,7 @@ public void stateTTL(AppRun.AppProtocol serviceAppProtocol) throws Exception {
190190 String actorType = "StatefulActorTest" ;
191191 logger .debug ("Building proxy ..." );
192192 ActorProxyBuilder <ActorProxy > proxyBuilder =
193- new ActorProxyBuilder (actorType , ActorProxy .class , newActorClient ());
193+ new ActorProxyBuilder (actorType , ActorProxy .class , deferClose ( run . newActorClient ());
194194 ActorProxy proxy = proxyBuilder .build (actorId );
195195
196196 // wating for actor to be activated
@@ -231,7 +231,7 @@ public void stateTTL(AppRun.AppProtocol serviceAppProtocol) throws Exception {
231231 serviceAppProtocol );
232232
233233 // 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 ());
235235 ActorProxy newProxy = proxyBuilder .build (actorId );
236236
237237 // waiting for actor to be activated
0 commit comments