{"action":"reopened","issue":{"url":"https://api.github.com/repos/RuedigerMoeller/kontraktor/issues/17","labels_url":"https://api.github.com/repos/RuedigerMoeller/kontraktor/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/RuedigerMoeller/kontraktor/issues/17/comments","events_url":"https://api.github.com/repos/RuedigerMoeller/kontraktor/issues/17/events","html_url":"https://github.com/RuedigerMoeller/kontraktor/issues/17","id":111206213,"number":17,"title":"'no actor found for key' after a lot of calls to tcp-published actor","user":{"login":"julianrz","id":1173784,"avatar_url":"https://avatars.githubusercontent.com/u/1173784?v=3","gravatar_id":"","url":"https://api.github.com/users/julianrz","html_url":"https://github.com/julianrz","followers_url":"https://api.github.com/users/julianrz/followers","following_url":"https://api.github.com/users/julianrz/following{/other_user}","gists_url":"https://api.github.com/users/julianrz/gists{/gist_id}","starred_url":"https://api.github.com/users/julianrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianrz/subscriptions","organizations_url":"https://api.github.com/users/julianrz/orgs","repos_url":"https://api.github.com/users/julianrz/repos","events_url":"https://api.github.com/users/julianrz/events{/privacy}","received_events_url":"https://api.github.com/users/julianrz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RuedigerMoeller/kontraktor/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-10-13T15:33:10Z","updated_at":"2015-10-17T17:06:55Z","closed_at":null,"body":"This code works for a few minutes and then looks like actor is no longer there, repeatedly prints:\r\nE 20:58:56:791 : tcp receiver :  : registry:836420849 no actor found for key RemoteCallEntry{receiverKey=1, futureKey=-2138972716, method='greet', args=[[B@54472710], queue=0}\r\n\r\norg.nustaq.kontraktor.KTimeoutException: Timeout\r\n\tat org.nustaq.kontraktor.Promise.awaitHelper(Promise.java:450)\r\n\tat org.nustaq.kontraktor.Promise.await(Promise.java:392)\r\n\tat org.nustaq.kontraktor.IPromise.await(IPromise.java:147)\r\n\tat com.company.Main$6.lambda$run$1(Main.java:157)\r\n\tat com.company.Main$6$$Lambda$23/1821835811.accept(Unknown Source)\r\n\tat java.util.ArrayList.forEach(ArrayList.java:1249)\r\n\tat com.company.Main$6.run(Main.java:156)\r\n\r\nDoes not look like it is out of memory when it fails. Tried several versions, including latest. \r\n\r\nIt is run with the following options -Xmx16g -XX:+UseG1GC; machine has 12 virtual cores and 64Gb total RAM\r\nJava(TM) SE Runtime Environment (build 1.8.0_51-b16)\r\nJava HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)\r\n```\r\npackage com.company;\r\n\r\nimport org.nustaq.kontraktor.Actor;\r\nimport org.nustaq.kontraktor.IPromise;\r\nimport org.nustaq.kontraktor.Promise;\r\n\r\npublic class HelloActor extends Actor<HelloActor> {\r\n    public IPromise<Integer> greet( byte[] b ) {\r\n        return new Promise<>(b.length);\r\n    }\r\n}\r\npackage com.company;\r\n\r\nimport org.nustaq.kontraktor.Callback;\r\nimport org.nustaq.kontraktor.IPromise;\r\nimport org.nustaq.kontraktor.remoting.base.ActorClientConnector;\r\nimport org.nustaq.kontraktor.remoting.base.ConnectableActor;\r\nimport org.nustaq.kontraktor.remoting.encoding.SerializerType;\r\nimport org.nustaq.kontraktor.remoting.tcp.TCPPublisher;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport static org.nustaq.kontraktor.Actors.AsActor;\r\n\r\npublic class Main {\r\n\r\n    public static void main(String[] args) throws InterruptedException {\r\n        testRemote();\r\n    }\r\n\r\n   static void testRemote() throws InterruptedException {\r\n        HelloActor myService  = AsActor(HelloActor.class,10000000);\r\n\r\n        Thread tpub = new Thread() {\r\n            public void run() {\r\n                try {\r\n                    new TCPPublisher()\r\n                            .facade(myService)\r\n                            .port(8181)\r\n                            .serType(SerializerType.FSTSer)\r\n                            .publish();\r\n                } catch(Exception ex){\r\n                    ex.printStackTrace();\r\n                }\r\n            }\r\n        };\r\n        tpub.start();\r\n\r\n        ConnectableActor con = new org.nustaq.kontraktor.remoting.tcp.TCPConnectable(HelloActor.class, \"localhost\", 8181);\r\n\r\n        Callback<ActorClientConnector> disconnectCallback = new Callback<ActorClientConnector>() {\r\n            @Override\r\n            public void complete(ActorClientConnector actorClientConnector, Object o) {\r\n                System.out.println(\"disconnect\");\r\n            }\r\n        };\r\n\r\n        try {\r\n            Thread.sleep(1000);\r\n        } catch (InterruptedException e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n        HelloActor act = (HelloActor) con.connect(disconnectCallback).await();\r\n\r\n        Thread thmain = new Thread() {\r\n            public void run() {\r\n                callActor(act);\r\n            }\r\n        };\r\n\r\n        thmain.setName(\"caller\");\r\n        thmain.start();\r\n\r\n        Thread thmain2 = new Thread() {\r\n            public void run() {\r\n               callActor(act);\r\n            }\r\n        };\r\n        thmain2.setName(\"caller2\");\r\n        thmain2.start();\r\n\r\n        thmain.join();\r\n        thmain2.join();\r\n        System.out.println(\"main threads finished\");\r\n    }\r\n\r\n    static void callActor(HelloActor act) {\r\n        byte [] bb = new byte[500];\r\n        long n=1000000;\r\n        try {\r\n            while (true) {\r\n\r\n                List<IPromise<Integer>> l = new ArrayList<>();\r\n                for (long i = 0; i < n; i++) {\r\n                    l.add(act.greet(bb));\r\n                }\r\n\r\n                l.forEach((integerIPromise) -> {\r\n                    try{integerIPromise.await();}catch(Throwable th){th.printStackTrace();}\r\n                });\r\n\r\n                l.forEach(p -> {\r\n                    try {\r\n                        p.get();\r\n                    } catch (Throwable th) {\r\n                        th.printStackTrace();\r\n                    }\r\n                });\r\n            }\r\n        } catch(Throwable th){\r\n            th.printStackTrace();\r\n        }\r\n    }\r\n}\r\n```"}}