ademakov commented on code in PR #1272:
URL: https://github.com/apache/ignite-3/pull/1272#discussion_r1010336147


##########
modules/platforms/cpp/tests/client-test/main.cpp:
##########
@@ -40,9 +52,23 @@ void before_all() {
 }
 
 int main(int argc, char **argv) {
+    // Install signal handlers to clean up resources on early exit.
+    signal(SIGABRT, signal_handler);
+    signal(SIGINT, signal_handler);
+
+    ignite::IgniteRunner runner;
+
+    shutdown_handler = [&](int signal) {
+        std::cout << "Caught signal " << signal << " during tests" << 
std::endl;
+
+        runner.stop();
+
+        std::cout << "Resources cleanup OK" << std::endl;
+    };

Review Comment:
   Why do we need this? As far as I see this will just kill the process without 
any cleanup. And I'm not sure why to intercept SIGABRT in any case.



##########
modules/platforms/cpp/ignite/network/detail/macos/connecting_context.h:
##########
@@ -0,0 +1,92 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#pragma once
+
+#include "macos_async_client.h"
+
+#include <ignite/network/end_point.h>
+#include <ignite/network/tcp_range.h>
+
+#include <cstdint>
+#include <memory>
+
+#include <netdb.h>
+
+namespace ignite::network::detail {
+
+/**
+* Connecting context.
+*/
+class connecting_context {

Review Comment:
   Is this much different from the linux code? Can we gather generic code for 
unix in one place?



##########
modules/platforms/cpp/tests/test-common/detail/macos_process.h:
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+// It's OK that this code is entirely in header as it only supposed to be 
included from a single file.
+
+#include "cmd_process.h"
+#include "unix_process.h"
+
+#include <chrono>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include <csignal>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+namespace ignite::detail {
+
+/**
+ * Implementation of CmdProcess for Windows.
+ */
+class MacosProcess : public ignite::detail::UnixProcess {

Review Comment:
   I see no much difference between LinuxProcess and MacosProcess. Why cannot 
we have just UnixProcess for both?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to