{"action":"created","comment":{"url":"https://api.github.com/repos/kiegroup/optaplanner/pulls/comments/183381345","pull_request_review_id":114366674,"id":183381345,"diff_hunk":"@@ -0,0 +1,74 @@\n+/*\n+ * Copyright 2018 Red Hat, Inc. and/or its affiliates.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.optaplanner.core.impl.solver.thread;\n+\n+import java.util.concurrent.ExecutorService;\n+import java.util.concurrent.TimeUnit;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+public class ThreadUtils {\n+\n+    protected static final transient Logger logger = LoggerFactory.getLogger(ThreadUtils.class);\n+\n+    public static void shutdownAwaitOrKill(ExecutorService executor, String logIndentation, String name) {\n+        // Intentionally clearing the interrupted flag so that awaitTermination() in step 3 works.\n+        if (Thread.interrupted()) {\n+            // 2a. If the current thread is interrupted, propagate interrupt signal to children by initiating","path":"optaplanner-core/src/main/java/org/optaplanner/core/impl/solver/thread/ThreadUtils.java","position":32,"original_position":32,"commit_id":"e1683d6bca97016c04bc5f6791897c4fc2224d16","original_commit_id":"e1683d6bca97016c04bc5f6791897c4fc2224d16","user":{"login":"ge0ffrey","id":176880,"avatar_url":"https://avatars1.githubusercontent.com/u/176880?v=4","gravatar_id":"","url":"https://api.github.com/users/ge0ffrey","html_url":"https://github.com/ge0ffrey","followers_url":"https://api.github.com/users/ge0ffrey/followers","following_url":"https://api.github.com/users/ge0ffrey/following{/other_user}","gists_url":"https://api.github.com/users/ge0ffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ge0ffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ge0ffrey/subscriptions","organizations_url":"https://api.github.com/users/ge0ffrey/orgs","repos_url":"https://api.github.com/users/ge0ffrey/repos","events_url":"https://api.github.com/users/ge0ffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ge0ffrey/received_events","type":"User","site_admin":false},"body":"Yes, we need to fix that, but I think we might need to simplify the whole thing here. It's probably overkilled.","created_at":"2018-04-23T12:48:08Z","updated_at":"2018-04-23T12:48:08Z","html_url":"https://github.com/kiegroup/optaplanner/pull/387#discussion_r183381345","pull_request_url":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kiegroup/optaplanner/pulls/comments/183381345"},"html":{"href":"https://github.com/kiegroup/optaplanner/pull/387#discussion_r183381345"},"pull_request":{"href":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387"}},"in_reply_to_id":182481539},"pull_request":{"url":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387","id":182204955,"html_url":"https://github.com/kiegroup/optaplanner/pull/387","diff_url":"https://github.com/kiegroup/optaplanner/pull/387.diff","patch_url":"https://github.com/kiegroup/optaplanner/pull/387.patch","issue_url":"https://api.github.com/repos/kiegroup/optaplanner/issues/387","number":387,"state":"open","locked":false,"title":"Multithreaded Local Search","user":{"login":"ge0ffrey","id":176880,"avatar_url":"https://avatars1.githubusercontent.com/u/176880?v=4","gravatar_id":"","url":"https://api.github.com/users/ge0ffrey","html_url":"https://github.com/ge0ffrey","followers_url":"https://api.github.com/users/ge0ffrey/followers","following_url":"https://api.github.com/users/ge0ffrey/following{/other_user}","gists_url":"https://api.github.com/users/ge0ffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ge0ffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ge0ffrey/subscriptions","organizations_url":"https://api.github.com/users/ge0ffrey/orgs","repos_url":"https://api.github.com/users/ge0ffrey/repos","events_url":"https://api.github.com/users/ge0ffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ge0ffrey/received_events","type":"User","site_admin":false},"body":"TODO:\r\n- clean up threads\r\n- manager thread lifecycle in solver\r\n- fix race condition PLANNER-1088\r\n\r\n@rsynek Out of about 30 runs, I saw 2 runs hanging, probably due to a race condition.\r\nThe first time, it was in a big 3-day benchmark, on the 3 subsingle of SA after 10 subsingles of TS.\r\nThe second time, it was on step 600 on a small CB TS configuration, so it's not that it ran out of resources.\r\n\r\nhttps://issues.jboss.org/browse/PLANNER-1088\r\n**I have not been able to reproducible reliably.** We need to first find a way to trigger it more frequently (I suspect playing with the buffer size, moveThreadCount, random sleeps, etc, might do it.)\r\n\r\nI now suspect the hanging is due to a dead-lock.","created_at":"2018-04-17T15:28:08Z","updated_at":"2018-04-23T12:48:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2441977ae751b492627611c5799ad4ffbc028bd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387/commits","review_comments_url":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387/comments","review_comment_url":"https://api.github.com/repos/kiegroup/optaplanner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kiegroup/optaplanner/issues/387/comments","statuses_url":"https://api.github.com/repos/kiegroup/optaplanner/statuses/e1683d6bca97016c04bc5f6791897c4fc2224d16","head":{"label":"ge0ffrey:multithreadedLocalSearch","ref":"multithreadedLocalSearch","sha":"e1683d6bca97016c04bc5f6791897c4fc2224d16","user":{"login":"ge0ffrey","id":176880,"avatar_url":"https://avatars1.githubusercontent.com/u/176880?v=4","gravatar_id":"","url":"https://api.github.com/users/ge0ffrey","html_url":"https://github.com/ge0ffrey","followers_url":"https://api.github.com/users/ge0ffrey/followers","following_url":"https://api.github.com/users/ge0ffrey/following{/other_user}","gists_url":"https://api.github.com/users/ge0ffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ge0ffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ge0ffrey/subscriptions","organizations_url":"https://api.github.com/users/ge0ffrey/orgs","repos_url":"https://api.github.com/users/ge0ffrey/repos","events_url":"https://api.github.com/users/ge0ffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ge0ffrey/received_events","type":"User","site_admin":false},"repo":{"id":1792278,"name":"optaplanner","full_name":"ge0ffrey/optaplanner","owner":{"login":"ge0ffrey","id":176880,"avatar_url":"https://avatars1.githubusercontent.com/u/176880?v=4","gravatar_id":"","url":"https://api.github.com/users/ge0ffrey","html_url":"https://github.com/ge0ffrey","followers_url":"https://api.github.com/users/ge0ffrey/followers","following_url":"https://api.github.com/users/ge0ffrey/following{/other_user}","gists_url":"https://api.github.com/users/ge0ffrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ge0ffrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ge0ffrey/subscriptions","organizations_url":"https://api.github.com/users/ge0ffrey/orgs","repos_url":"https://api.github.com/users/ge0ffrey/repos","events_url":"https://api.github.com/users/ge0ffrey/events{/privacy}","received_events_url":"https://api.github.com/users/ge0ffrey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ge0ffrey/optaplanner","description":"This is my fork. Go to the blessed repo instead!","fork":true,"url":"https://api.github.com/repos/ge0ffrey/optaplanner","forks_url":"https://api.github.com/repos/ge0ffrey/optaplanner/forks","keys_url":"https://api.github.com/repos/ge0ffrey/optaplanner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ge0ffrey/optaplanner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ge0ffrey/optaplanner/teams","hooks_url":"https://api.github.com/repos/ge0ffrey/optaplanner/hooks","issue_events_url":"https://api.github.com/repos/ge0ffrey/optaplanner/issues/events{/number}","events_url":"https://api.github.com/repos/ge0ffrey/optaplanner/events","assignees_url":"https://api.github.com/repos/ge0ffrey/optaplanner/assignees{/user}","branches_url":"https://api.github.com/repos/ge0ffrey/optaplanner/branches{/branch}","tags_url":"https://api.github.com/repos/ge0ffrey/optaplanner/tags","blobs_url":"https://api.github.com/repos/ge0ffrey/optaplanner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ge0ffrey/optaplanner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ge0ffrey/optaplanner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ge0ffrey/optaplanner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ge0ffrey/optaplanner/statuses/{sha}","languages_url":"https://api.github.com/repos/ge0ffrey/optaplanner/languages","stargazers_url":"https://api.github.com/repos/ge0ffrey/optaplanner/stargazers","contributors_url":"https://api.github.com/repos/ge0ffrey/optaplanner/contributors","subscribers_url":"https://api.github.com/repos/ge0ffrey/optaplanner/subscribers","subscription_url":"https://api.github.com/repos/ge0ffrey/optaplanner/subscription","commits_url":"https://api.github.com/repos/ge0ffrey/optaplanner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ge0ffrey/optaplanner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ge0ffrey/optaplanner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ge0ffrey/optaplanner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ge0ffrey/optaplanner/contents/{+path}","compare_url":"https://api.github.com/repos/ge0ffrey/optaplanner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ge0ffrey/optaplanner/merges","archive_url":"https://api.github.com/repos/ge0ffrey/optaplanner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ge0ffrey/optaplanner/downloads","issues_url":"https://api.github.com/repos/ge0ffrey/optaplanner/issues{/number}","pulls_url":"https://api.github.com/repos/ge0ffrey/optaplanner/pulls{/number}","milestones_url":"https://api.github.com/repos/ge0ffrey/optaplanner/milestones{/number}","notifications_url":"https://api.github.com/repos/ge0ffrey/optaplanner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ge0ffrey/optaplanner/labels{/name}","releases_url":"https://api.github.com/repos/ge0ffrey/optaplanner/releases{/id}","deployments_url":"https://api.github.com/repos/ge0ffrey/optaplanner/deployments","created_at":"2011-05-24T07:49:08Z","updated_at":"2018-03-28T10:47:19Z","pushed_at":"2018-04-18T13:14:01Z","git_url":"git://github.com/ge0ffrey/optaplanner.git","ssh_url":"git@github.com:ge0ffrey/optaplanner.git","clone_url":"https://github.com/ge0ffrey/optaplanner.git","svn_url":"https://github.com/ge0ffrey/optaplanner","homepage":"https://www.optaplanner.org/","size":166838,"stargazers_count":9,"watchers_count":9,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":9,"default_branch":"master"}},"base":{"label":"kiegroup:master","ref":"master","sha":"842f034c1a0a2d6423eb523c16a33bdaebe9b04e","user":{"login":"kiegroup","id":517980,"avatar_url":"https://avatars3.githubusercontent.com/u/517980?v=4","gravatar_id":"","url":"https://api.github.com/users/kiegroup","html_url":"https://github.com/kiegroup","followers_url":"https://api.github.com/users/kiegroup/followers","following_url":"https://api.github.com/users/kiegroup/following{/other_user}","gists_url":"https://api.github.com/users/kiegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/kiegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiegroup/subscriptions","organizations_url":"https://api.github.com/users/kiegroup/orgs","repos_url":"https://api.github.com/users/kiegroup/repos","events_url":"https://api.github.com/users/kiegroup/events{/privacy}","received_events_url":"https://api.github.com/users/kiegroup/received_events","type":"Organization","site_admin":false},"repo":{"id":1370858,"name":"optaplanner","full_name":"kiegroup/optaplanner","owner":{"login":"kiegroup","id":517980,"avatar_url":"https://avatars3.githubusercontent.com/u/517980?v=4","gravatar_id":"","url":"https://api.github.com/users/kiegroup","html_url":"https://github.com/kiegroup","followers_url":"https://api.github.com/users/kiegroup/followers","following_url":"https://api.github.com/users/kiegroup/following{/other_user}","gists_url":"https://api.github.com/users/kiegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/kiegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiegroup/subscriptions","organizations_url":"https://api.github.com/users/kiegroup/orgs","repos_url":"https://api.github.com/users/kiegroup/repos","events_url":"https://api.github.com/users/kiegroup/events{/privacy}","received_events_url":"https://api.github.com/users/kiegroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kiegroup/optaplanner","description":"Java Constraint Solver to solve vehicle routing, employee rostering and other planning problems.","fork":false,"url":"https://api.github.com/repos/kiegroup/optaplanner","forks_url":"https://api.github.com/repos/kiegroup/optaplanner/forks","keys_url":"https://api.github.com/repos/kiegroup/optaplanner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiegroup/optaplanner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiegroup/optaplanner/teams","hooks_url":"https://api.github.com/repos/kiegroup/optaplanner/hooks","issue_events_url":"https://api.github.com/repos/kiegroup/optaplanner/issues/events{/number}","events_url":"https://api.github.com/repos/kiegroup/optaplanner/events","assignees_url":"https://api.github.com/repos/kiegroup/optaplanner/assignees{/user}","branches_url":"https://api.github.com/repos/kiegroup/optaplanner/branches{/branch}","tags_url":"https://api.github.com/repos/kiegroup/optaplanner/tags","blobs_url":"https://api.github.com/repos/kiegroup/optaplanner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiegroup/optaplanner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiegroup/optaplanner/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiegroup/optaplanner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiegroup/optaplanner/statuses/{sha}","languages_url":"https://api.github.com/repos/kiegroup/optaplanner/languages","stargazers_url":"https://api.github.com/repos/kiegroup/optaplanner/stargazers","contributors_url":"https://api.github.com/repos/kiegroup/optaplanner/contributors","subscribers_url":"https://api.github.com/repos/kiegroup/optaplanner/subscribers","subscription_url":"https://api.github.com/repos/kiegroup/optaplanner/subscription","commits_url":"https://api.github.com/repos/kiegroup/optaplanner/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiegroup/optaplanner/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiegroup/optaplanner/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiegroup/optaplanner/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiegroup/optaplanner/contents/{+path}","compare_url":"https://api.github.com/repos/kiegroup/optaplanner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiegroup/optaplanner/merges","archive_url":"https://api.github.com/repos/kiegroup/optaplanner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiegroup/optaplanner/downloads","issues_url":"https://api.github.com/repos/kiegroup/optaplanner/issues{/number}","pulls_url":"https://api.github.com/repos/kiegroup/optaplanner/pulls{/number}","milestones_url":"https://api.github.com/repos/kiegroup/optaplanner/milestones{/number}","notifications_url":"https://api.github.com/repos/kiegroup/optaplanner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiegroup/optaplanner/labels{/name}","releases_url":"https://api.github.com/repos/kiegroup/optaplanner/releases{/id}","deployments_url":"https://api.github.com/repos/kiegroup/optaplanner/deployments","created_at":"2011-02-15T19:38:23Z","updated_at":"2018-04-23T09:06:20Z","pushed_at":"2018-04-20T15:36:16Z","git_url":"git://github.com/kiegroup/optaplanner.git","ssh_url":"git@github.com:kiegroup/optaplanner.git","clone_url":"https://github.com/kiegroup/optaplanner.git","svn_url":"https://github.com/kiegroup/optaplanner","homepage":"https://www.optaplanner.org","size":167173,"stargazers_count":821,"watchers_count":821,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":416,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":416,"open_issues":4,"watchers":821,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387"},"html":{"href":"https://github.com/kiegroup/optaplanner/pull/387"},"issue":{"href":"https://api.github.com/repos/kiegroup/optaplanner/issues/387"},"comments":{"href":"https://api.github.com/repos/kiegroup/optaplanner/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/kiegroup/optaplanner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kiegroup/optaplanner/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/kiegroup/optaplanner/statuses/e1683d6bca97016c04bc5f6791897c4fc2224d16"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ge0ffrey"}}