From 5f9a421490d507e3a3d739f649e59bca0295014a Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Thu, 11 Apr 2019 10:28:21 -0400 Subject: [PATCH 1/7] Additional logging for QueryServer::get_names error --- src/lib/md/relay/QueryServer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/md/relay/QueryServer.cpp b/src/lib/md/relay/QueryServer.cpp index 7b409662f..306e51372 100644 --- a/src/lib/md/relay/QueryServer.cpp +++ b/src/lib/md/relay/QueryServer.cpp @@ -380,9 +380,8 @@ public: google::protobuf::MapPair v(h.handle.key(), security.ice().security_desc()); x->insert(v); } - else - { - LOG(md,Error, "Invalid ExchangeData_case {}", security.ExchangeData_case()); + else { + LOG(md,Error, "Invalid ExchangeData_case {} for security {}", security.ExchangeData_case(), h.handle.key()); } } } From 7381088d6d9b042826b10e09a6b96505da0230a8 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Thu, 11 Apr 2019 11:07:49 -0400 Subject: [PATCH 2/7] Remove unnecessary error log --- src/lib/md/relay/QueryServer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/md/relay/QueryServer.cpp b/src/lib/md/relay/QueryServer.cpp index 306e51372..64297f5b0 100644 --- a/src/lib/md/relay/QueryServer.cpp +++ b/src/lib/md/relay/QueryServer.cpp @@ -380,9 +380,7 @@ public: google::protobuf::MapPair v(h.handle.key(), security.ice().security_desc()); x->insert(v); } - else { - LOG(md,Error, "Invalid ExchangeData_case {} for security {}", security.ExchangeData_case(), h.handle.key()); - } + // There is currently no ExchangeData for synthetics } } } From 02d0f6191ce573fa2bdd2f2a9a715979ca43672e Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Thu, 18 Apr 2019 14:06:44 -0400 Subject: [PATCH 3/7] -added a manifest to our csproj that we'd meant to add anyway for win7 subprocess creation -added a fallback for stunnel if we can't create a windows job object --- src/client/spark/App.xaml.cs | 53 +++++++++++++++++++++++------------ src/client/spark/Spark.csproj | 3 +- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index 25aecff08..4fd7024dc 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -75,6 +75,37 @@ namespace mbts.ui.shell Environment.Exit(0); } + void start_stunnel(string path, uint job_error) + { + string config_error; + if (!mbts.config.Configuration.try_initialize(out config_error)) + { + _stunnel_process = Process.Start(path + "bin\\stunnel.exe"); + if (_stunnel_process != null) + { + for (int i = 0; i < 10; i++) + { + if (mbts.config.Configuration.try_initialize(out config_error)) + break; + System.Threading.Thread.Sleep(500); + } + } + else + stunnel_job_error = "Stunnel Job Error code: " + job_error + + " could not start stunnel " + (config_error ?? string.Empty); + } + } + + void kill_stunnel() + { + try + { + Process[] ps = Process.GetProcessesByName("stunnel"); + ps.ForEach(p => p.Kill()); + } + catch { } + } + Process _stunnel_process; static internal string stunnel_job_error { get; private set;} void init_stunnel(string[] argv) @@ -85,24 +116,10 @@ namespace mbts.ui.shell if (File.Exists(path + "config\\stunnel.conf")) { uint job_error = BTSUINativeMethods.setup_process_job_object(); - if(job_error == 0) - { - _stunnel_process = Process.Start(path + "bin\\stunnel.exe"); - string config_error; bool success = false; - if(_stunnel_process != null) - { - for(int i = 0; i < 10; i++) - { - if(success = mbts.config.Configuration.try_initialize(out config_error)) - break; - System.Threading.Thread.Sleep(500); - } - } - else - stunnel_job_error = "Stunnel Job Error code: " + job_error + " could not start stunnel"; - } - else - stunnel_job_error = "Stunnel Job Error code: " + job_error; + //if we can't put this process and stunnel into a job, try to stop stunnel then restart + if(job_error != 0) + kill_stunnel(); + start_stunnel(path, job_error); } } catch(Exception ex) diff --git a/src/client/spark/Spark.csproj b/src/client/spark/Spark.csproj index c6eb7e982..dbf62a939 100644 --- a/src/client/spark/Spark.csproj +++ b/src/client/spark/Spark.csproj @@ -4,7 +4,8 @@ Blue Trading Systems Blue Trading Systems Spark - The game has changed. Make your Move. + Advanced Derivatives Trading + spark.manifest true Debug;Release x64 From 546553406ba208b839c6ee855237cc7942a92e67 Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Thu, 18 Apr 2019 14:13:09 -0400 Subject: [PATCH 4/7] PR comments --- src/client/spark/App.xaml.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index 4fd7024dc..36810c745 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -101,7 +101,14 @@ namespace mbts.ui.shell try { Process[] ps = Process.GetProcessesByName("stunnel"); - ps.ForEach(p => p.Kill()); + ps.ForEach(p => + { + try + { + p.Kill(); + } + catch {} + }); } catch { } } From 7838bdf04f7119c0d65f26a68dcbd5ccbeb43ca0 Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Thu, 18 Apr 2019 14:16:08 -0400 Subject: [PATCH 5/7] too much whitespace for even me --- src/client/spark/App.xaml.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/client/spark/App.xaml.cs b/src/client/spark/App.xaml.cs index 36810c745..ea2b1de78 100644 --- a/src/client/spark/App.xaml.cs +++ b/src/client/spark/App.xaml.cs @@ -103,10 +103,7 @@ namespace mbts.ui.shell Process[] ps = Process.GetProcessesByName("stunnel"); ps.ForEach(p => { - try - { - p.Kill(); - } + try { p.Kill(); } catch {} }); } From 5b71918a1f465d18af13893035224af8f546a5a8 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 22 Apr 2019 16:41:48 -0400 Subject: [PATCH 6/7] Revert "Make sure every sparkcmd command respects -configserver" This reverts commit dab95d7e91a02fd8ddb1cccdcdafddf3ce8a784f. --- src/client/sparkcmd/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/sparkcmd/Program.cs b/src/client/sparkcmd/Program.cs index 790308e27..c4b3c8cd3 100644 --- a/src/client/sparkcmd/Program.cs +++ b/src/client/sparkcmd/Program.cs @@ -9,7 +9,6 @@ using System.Linq; namespace sparkcmd { class Program { static int Main(string[] args) { - mbts.config.Configuration.initialize(); var commands = ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Program)); return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); } From 80e337c5996ecc9b61cf77c41051ddf2278159a6 Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Mon, 22 Apr 2019 16:45:36 -0400 Subject: [PATCH 7/7] sparkcmd should respect '-configserver' --- src/client/sparkcmd/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/sparkcmd/Program.cs b/src/client/sparkcmd/Program.cs index c4b3c8cd3..504ce8daf 100644 --- a/src/client/sparkcmd/Program.cs +++ b/src/client/sparkcmd/Program.cs @@ -9,6 +9,7 @@ using System.Linq; namespace sparkcmd { class Program { static int Main(string[] args) { + mbts.utils.BTSNativeMethods.provide_command_line(args, args.Length); var commands = ConsoleCommandDispatcher.FindCommandsInSameAssemblyAs(typeof(Program)); return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); }