From a725d86c4afb6daae851963c146aa439acbebf76 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Fri, 20 Oct 2017 21:03:14 +0000 Subject: [PATCH 1/9] Tweaked replication tools. --- tools/replicator/build_win.sh | 4 ++-- tools/replicator/replicate_to_windows_vm.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/replicator/build_win.sh b/tools/replicator/build_win.sh index d2ed8b7ed..a885b58ba 100644 --- a/tools/replicator/build_win.sh +++ b/tools/replicator/build_win.sh @@ -1,6 +1,6 @@ #!/bin/bash SCRIPT=$(readlink -f "$0") SCRIPTPATH=$(dirname "$SCRIPT") -echo $SCRIPTPATH -$SCRIPTPATH/replicate_to_windows_vm.py && ssh -p 2222 bts@localhost "cd /mnt/c/Users/bts/spark/tools && /mnt/c/Windows/System32/cmd.exe /c clientbuild.cmd" +#$SCRIPTPATH/replicate_to_windows_vm.py && \ +ssh -p 2222 bts@localhost "cd /mnt/c/Users/bts/spark/tools && /mnt/c/Windows/System32/cmd.exe /c clientbuild.cmd" diff --git a/tools/replicator/replicate_to_windows_vm.py b/tools/replicator/replicate_to_windows_vm.py index 668e6cd02..fcf7c8d79 100644 --- a/tools/replicator/replicate_to_windows_vm.py +++ b/tools/replicator/replicate_to_windows_vm.py @@ -13,6 +13,7 @@ ignore = Path docker ignore = Regex .*\.pyc ignore = Path x64 ignore = Path .vs +repeat = watch batch = true ''' From 1b60afc78d4ee65d34d5e30bfde98887d20b6562 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Fri, 20 Oct 2017 21:09:04 +0000 Subject: [PATCH 2/9] launchSettings.json should not be in git --- .gitignore | 2 +- src/client/spark/Properties/launchSettings.json | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 src/client/spark/Properties/launchSettings.json diff --git a/.gitignore b/.gitignore index 529f4142d..276cb02f0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ obj/ msbuild.log *.orig vcxproj.user -launchSettings.json +src/client/spark/Properties/launchSettings.json diff --git a/src/client/spark/Properties/launchSettings.json b/src/client/spark/Properties/launchSettings.json deleted file mode 100644 index b73373800..000000000 --- a/src/client/spark/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "Spark": { - "commandName": "Project", - "workingDirectory": "$(OutputPath)" - } - } -} \ No newline at end of file From b21ac58dcdbe9a5ca1f1a2648132b1a7e907c59c Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Mon, 23 Oct 2017 13:46:27 +0000 Subject: [PATCH 3/9] Prevented logging of left value pointers. --- src/lib/api/public/ServiceContext.cpp | 2 +- src/lib/logging/MsgPacking.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/api/public/ServiceContext.cpp b/src/lib/api/public/ServiceContext.cpp index 70ee413f7..3422640b7 100644 --- a/src/lib/api/public/ServiceContext.cpp +++ b/src/lib/api/public/ServiceContext.cpp @@ -20,7 +20,7 @@ ServiceContext::~ServiceContext() { } std::unique_ptr ServiceContext::create_channel(const char * type_name, const char * service_qualifier) const { - LOG(Api,Info,"Locate Service: {}{}",type_name ,service_qualifier); + LOG(Api,Info,"Locate Service: {}{}",std::string(type_name) ,std::string(service_qualifier)); return std::unique_ptr(new QuickbusClientChannel(_qbus, type_name, service_qualifier)); } diff --git a/src/lib/logging/MsgPacking.h b/src/lib/logging/MsgPacking.h index 97dbe2dd6..f83d52319 100644 --- a/src/lib/logging/MsgPacking.h +++ b/src/lib/logging/MsgPacking.h @@ -53,7 +53,7 @@ struct CheckPtr : public CheckPtr { template void pack_msg_args(std::array &buffer,Args&&...args) { using Store = std::tuple::type...>; - static_assert(CheckPtr::value,"Illegal type logged"); + static_assert(CheckPtr::type...>::value,"Illegal type logged"); if(sizeof(Store) <= SZ) new (&buffer[0]) Store(std::forward(args)...); else { From f93c7bb1434d2c06f06d0249233ddd6b9c6f2348 Mon Sep 17 00:00:00 2001 From: Pedro Pinto Date: Mon, 23 Oct 2017 13:47:09 +0000 Subject: [PATCH 4/9] Tring vscode for debugging. --- .vscode/launch.json | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 36fdd03c8..29133e2f2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,7 +1,25 @@ { "version": "0.2.0", "configurations": [ - + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceRoot}/build/gcc_debug/src/server/sparkd/sparkd", + "args": ["run"], + "stopAtEntry": false, + "cwd": "${workspaceRoot}/build/gcc_debug/src/server/sparkd", + "environment": [], + "externalConsole": true, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, { "name": "Client Launch", "type": "clr", @@ -11,8 +29,8 @@ "cwd": "${workspaceRoot}", "stopAtEntry": false, "externalConsole": true - }, - { + }, + { "name": "Client Attach", "type": "clr", "request": "attach", From 8ccbdc9443f8d4d5e83d8b9fb2003e9afa09a165 Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Mon, 23 Oct 2017 09:36:53 -0500 Subject: [PATCH 5/9] Claiming an ilink session for CME CERT execution testing --- src/lib/config/defaults/jetfix.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/config/defaults/jetfix.conf b/src/lib/config/defaults/jetfix.conf index 100a60b29..58ed958e3 100644 --- a/src/lib/config/defaults/jetfix.conf +++ b/src/lib/config/defaults/jetfix.conf @@ -71,7 +71,7 @@ JetFIX { platform: GLBX socket_connect_host_ip: "69.50.112.177" socket_connect_port: 61924 - sender_compid: "MC7004N" + sender_compid: "MC8004N" target_compid: "CME" target_subid: "64" start_time: "00:30:00" @@ -142,5 +142,11 @@ SparkConnection { rule: "System.host_name=='TAHA-SUPER_spark'" value {connection_name: "cme_mc1"} } + +# Jake Chapel Hill CME Cert-accessible host +SparkConnection { + rule: "System.host_name=='bts-host15'" + value {connection_name: "cme_mc8"} +} SparkConnection {value {connection_name: "cme_mbx"}} From a2b33c1c9f3edccc94f3392b37b45e403208e2bd Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 23 Oct 2017 11:21:54 -0400 Subject: [PATCH 6/9] Fix double dispose in ApiClient --- src/client/spark_api/api/Channels/QuickBusClientChannel.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/client/spark_api/api/Channels/QuickBusClientChannel.cs b/src/client/spark_api/api/Channels/QuickBusClientChannel.cs index c7772580b..7570d645e 100644 --- a/src/client/spark_api/api/Channels/QuickBusClientChannel.cs +++ b/src/client/spark_api/api/Channels/QuickBusClientChannel.cs @@ -14,7 +14,6 @@ namespace bts.api.core { internal class QuickbusClientChannel : ClientChannel { IntPtr _client; - List _subscriptions = new List(); public QuickbusClientChannel(ServiceContext context, string type_name, string qualifier) : base(context) { _client = ApiNativeMethods.api_client_create(context.native_context, type_name, qualifier); @@ -22,10 +21,6 @@ namespace bts.api.core { } public override void Dispose() { - foreach (var sub in _subscriptions) { - ApiNativeMethods.api_client_unsubscribe(_client, sub); - } - _subscriptions.Clear(); ApiNativeMethods.api_client_destroy(_client); _client = IntPtr.Zero; } @@ -84,10 +79,8 @@ namespace bts.api.core { } }; var subscription = ApiNativeMethods.api_client_subscribe(_client, method_and_qualifier, cb, IntPtr.Zero); - _subscriptions.Add(subscription); return FinalizeableAnonymousDisposable.Create((disposing) => { ApiNativeMethods.api_client_unsubscribe(_client, subscription); - _subscriptions.Remove(subscription); // keepalive cb = null; if (!disposing) { From af1cb0cbbb950b3ed4c9a313d1c8c0db049f3a68 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 23 Oct 2017 11:22:39 -0400 Subject: [PATCH 7/9] NUnit test runner version must match NUnit otherwise mysterious errors aboud. --- src/client/spark/Spark.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/spark/Spark.csproj b/src/client/spark/Spark.csproj index 4aa616e0e..366292a59 100644 --- a/src/client/spark/Spark.csproj +++ b/src/client/spark/Spark.csproj @@ -34,7 +34,7 @@ - + From 01104807f67e72d2331ce63e5f5287ee4aff0455 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 23 Oct 2017 11:23:54 -0400 Subject: [PATCH 8/9] Table subscriptions need to be kept alive or the subscription gets finalized and unsubscribed. --- src/client/spark/sys/api/Test/ApiTests.cs | 81 ++++++++++++----------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/src/client/spark/sys/api/Test/ApiTests.cs b/src/client/spark/sys/api/Test/ApiTests.cs index 66c16584b..d7e80b17a 100644 --- a/src/client/spark/sys/api/Test/ApiTests.cs +++ b/src/client/spark/sys/api/Test/ApiTests.cs @@ -1,4 +1,4 @@ -using bts.api; +using bts.api; using bts.api.core; using bts.api.test; using NUnit.Framework; @@ -64,6 +64,7 @@ namespace mbts.api.Test { [Test] public void hello_server_test() { + //System.Windows.MessageBox.Show("attach debugger"); _mtest.run_hello_service(null); _mtest.run_shout_service(null); @@ -71,48 +72,48 @@ namespace mbts.api.Test { var h = _context.locate(); TableUpdate last_update = null; - h.subscribe_greetings().table().Subscribe(t => last_update = t); + using (var sub1 = h.subscribe_greetings().table().Subscribe(t => last_update = t)) { - var response = h.say_hello(new HelloRequest() { Name = "UnitTest 1" }); - Assert.AreEqual("Hello UnitTest 1", response.Message); - Assert.NotNull(last_update); - Assert.True(last_update.added.Count == 1); - Assert.True(last_update.removed.Count == 0); - Assert.True(last_update.state.Count == 1); - Assert.True(last_update.state.Single().Value.Message == "Hello UnitTest 1"); - last_update = null; - response = h.yell_hello(new HelloRequest() { Name = "UnitTest 2" }); - Assert.AreEqual("HELLO UNITTEST 2", response.Message); - Assert.NotNull(last_update); - Assert.True(last_update.added.Count == 1); - Assert.True(last_update.removed.Count == 1); - Assert.True(last_update.state.Count == 1); - Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 2"); - last_update = null; + var response = h.say_hello(new HelloRequest() { Name = "UnitTest 1" }); + Assert.AreEqual("Hello UnitTest 1", response.Message); + Assert.NotNull(last_update); + Assert.True(last_update.added.Count == 1); + Assert.True(last_update.removed.Count == 0); + Assert.True(last_update.state.Count == 1); + Assert.True(last_update.state.Single().Value.Message == "Hello UnitTest 1"); + last_update = null; + response = h.yell_hello(new HelloRequest() { Name = "UnitTest 2" }); + Assert.AreEqual("HELLO UNITTEST 2", response.Message); + Assert.NotNull(last_update); + Assert.True(last_update.added.Count == 1); + Assert.True(last_update.removed.Count == 1); + Assert.True(last_update.state.Count == 1); + Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 2"); + last_update = null; - // Managed shout, Native hello - _mtest.stop_hello_service(null); - _ntest.run_hello_service(null); - response = h.yell_hello(new HelloRequest() { Name = "UnitTest 3" }); - Assert.AreEqual("HELLO UNITTEST 3", response.Message); - Assert.NotNull(last_update); - Assert.True(last_update.added.Count == 1); - Assert.True(last_update.removed.Count == 1); - Assert.True(last_update.state.Count == 1); - Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 3"); - last_update = null; - - // Native+native - _mtest.stop_shout_service(null); - _ntest.run_shout_service(null); - response = h.yell_hello(new HelloRequest() { Name = "UnitTest 4" }); - Assert.AreEqual("HELLO UNITTEST 4", response.Message); - Assert.True(last_update.added.Count == 1); - Assert.True(last_update.removed.Count == 1); - Assert.True(last_update.state.Count == 1); - Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 4"); - last_update = null; + // Managed shout, Native hello + _mtest.stop_hello_service(null); + _ntest.run_hello_service(null); + response = h.yell_hello(new HelloRequest() { Name = "UnitTest 3" }); + Assert.AreEqual("HELLO UNITTEST 3", response.Message); + Assert.NotNull(last_update); + Assert.True(last_update.added.Count == 1); + Assert.True(last_update.removed.Count == 1); + Assert.True(last_update.state.Count == 1); + Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 3"); + last_update = null; + // Native+native + _mtest.stop_shout_service(null); + _ntest.run_shout_service(null); + response = h.yell_hello(new HelloRequest() { Name = "UnitTest 4" }); + Assert.AreEqual("HELLO UNITTEST 4", response.Message); + Assert.True(last_update.added.Count == 1); + Assert.True(last_update.removed.Count == 1); + Assert.True(last_update.state.Count == 1); + Assert.True(last_update.state.Single().Value.Message == "HELLO UNITTEST 4"); + last_update = null; + } _ntest.stop_hello_service(null); _ntest.stop_shout_service(null); } From 2c226f0ac813a99d95daf9871af0833884527707 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 23 Oct 2017 11:24:20 -0400 Subject: [PATCH 9/9] Pretty sure Automatically restarting docker is the desired behavior. --- tools/spark_vm_shell.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/spark_vm_shell.sh b/tools/spark_vm_shell.sh index c506be1f8..29d11f38b 100644 --- a/tools/spark_vm_shell.sh +++ b/tools/spark_vm_shell.sh @@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" docker run \ --rm \ - -i \ + --restart=unless-stopped \ -p 8000:8000 \ -p 8001:8001 \ -p 8080:8080 \