Github user dragos commented on a diff in the pull request:
https://github.com/apache/spark/pull/11272#discussion_r53634517
--- Diff:
network/shuffle/src/main/java/org/apache/spark/network/shuffle/mesos/MesosExternalShuffleClient.java
---
@@ -53,21 +65,55 @@ public MesosExternalShuffleClient(
super(conf, secretKeyHolder, saslEnabled, saslEncryptionEnabled);
}
- public void registerDriverWithShuffleService(String host, int port)
throws IOException {
+ public void registerDriverWithShuffleService(String host, int port, long
heartbeatTimeoutMs)
+ throws IOException {
+
checkInit();
- ByteBuffer registerDriver = new RegisterDriver(appId).toByteBuffer();
+ ByteBuffer registerDriver = new RegisterDriver(appId,
heartbeatTimeoutMs).toByteBuffer();
TransportClient client = clientFactory.createClient(host, port);
- client.sendRpc(registerDriver, new RpcResponseCallback() {
- @Override
- public void onSuccess(ByteBuffer response) {
- logger.info("Successfully registered app " + appId + " with
external shuffle service.");
- }
-
- @Override
- public void onFailure(Throwable e) {
- logger.warn("Unable to register app " + appId + " with external
shuffle service. " +
+ client.sendRpc(registerDriver, new RegisterDriverCallback(client,
heartbeatTimeoutMs));
+ }
+
+ private class RegisterDriverCallback implements RpcResponseCallback {
+ private final TransportClient client;
+ private final long heartbeatTimeoutMs;
+
+ private RegisterDriverCallback(TransportClient client, long
heartbeatTimeoutMs) {
+ this.client = client;
+ this.heartbeatTimeoutMs = heartbeatTimeoutMs;
+ }
+
+ @Override
+ public void onSuccess(ByteBuffer response) {
+ heartbeaterThread.scheduleAtFixedRate(
+ new Heartbeater(client), 0, heartbeatTimeoutMs / 4,
TimeUnit.MILLISECONDS);
--- End diff --
There's a `spark.executor.heartbeatInterval`, so maybe that's less
surprising for users
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]