-
Notifications
You must be signed in to change notification settings - Fork 52
fix: prevent sender control future race #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 18 commits
abca23b
1f28ea1
6672de9
3d8441a
187a83f
ff76512
61bbf71
ca692c6
99e825d
e60d48d
f82527a
d95a78d
fb16daf
0d9dea2
0834ca0
a29a85f
ff95dfd
e280e30
570ddc9
4ac16f9
c0a98e2
af0863a
d6361b7
5915c93
8492fd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,7 @@ public class WorkerService implements Closeable { | |
|
|
||
| private volatile boolean inited; | ||
| private volatile boolean closed; | ||
| private volatile boolean registered; | ||
|
|
||
| private final ComputerContext context; | ||
| private final Map<Integer, ContainerInfo> workers; | ||
|
|
@@ -83,6 +84,7 @@ public WorkerService() { | |
| this.workers = new HashMap<>(); | ||
| this.inited = false; | ||
| this.closed = false; | ||
| this.registered = false; | ||
| this.shutdownHook = new ShutdownHook(); | ||
| } | ||
|
|
||
|
|
@@ -113,6 +115,7 @@ public synchronized void init(Config config) { | |
|
|
||
| LOG.info("{} register WorkerService", this); | ||
| this.bsp4Worker.workerInitDone(); | ||
| this.registered = true; | ||
| this.connectToWorkers(); | ||
|
|
||
| this.computeManager = new ComputeManager(this.workerInfo.id(), this.context, | ||
|
|
@@ -176,7 +179,6 @@ public synchronized void close() { | |
| this.computeManager.close(); | ||
| } else { | ||
| LOG.warn("The computeManager is null"); | ||
| return; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Evidence — harness compiled against this head (registers In Requested change: make |
||
| } catch (Exception e) { | ||
| LOG.error("Error when closing ComputeManager", e); | ||
|
|
@@ -194,8 +196,12 @@ public synchronized void close() { | |
| } | ||
|
|
||
| try { | ||
| this.bsp4Worker.workerCloseDone(); | ||
| this.bsp4Worker.close(); | ||
| if (this.bsp4Worker != null) { | ||
| if (this.registered) { | ||
| this.bsp4Worker.workerCloseDone(); | ||
| } | ||
| this.bsp4Worker.close(); | ||
| } | ||
| } catch (Exception e) { | ||
| LOG.error("Error while closing bsp4Worker", e); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.