Commit Graph
13582 Commits
Author SHA1 Message Date
John Colvin a697cc4958 Assert TcpConnection endpoint matches expected 2024-10-21 13:29:59 +00:00
John Colvin 596478d978 Fix typo in log msg (was missing interpolation '$') 2024-10-21 13:29:59 +00:00
John Colvin 6cace25a7c Catch exceptions on AsyncTCPConnector_AsyncWrapper background thread
Since it spawns a new thread on each attempt, uncaught exceptions were previously undetected,
and caused silent failures down the pipe. This should make it easier to track such bugs down.
2024-10-21 13:29:59 +00:00
John Colvin 6a723b913f fix: Format PubSubRoute as json in log msgs
It was previously using the default ToString, which simply returns the type name
2024-10-21 13:29:59 +00:00
John Colvin 4afbca2e05 build: Upgrade packages (deps) in DataStreamTests 2024-10-21 13:29:59 +00:00
John Colvin 17efe0a411 cleanup: Remove unused ViewStreamDatabase config 2024-10-21 13:29:59 +00:00
John Colvin e4edcfba53 vscode: Add PubSubServer debug cfg to skip build 2024-10-21 13:29:59 +00:00
John Colvin 6a881c8f2b Configure apps as a distributed system via Docker compose 2024-10-21 13:29:59 +00:00
John Colvin 4c5c4388b5 Remove reference to spark protobuf Config in ViewStream
We can't read spark protobuf Config until it has been initialized,
and since ViewStream doesn't have the configServer param handy it
isn't able to initialize config if necessary. In that case, it would simply
block until config was initialized by someone else. Such a risk doesn't
seem justified for this particular configuration dependency
(DataStreamConfig.UseUncopiedNewRowsInFire). For now, its hardcoded to false.
2024-10-21 13:29:59 +00:00
John Colvin e8f5407e2f refactor: Run RemoteQueryManager as an IHostedService
This paradigm more accurately represents the RemoteQueryManager as a
Service that can be started/stopped.
2024-10-21 13:29:59 +00:00
John Colvin 3f0d3889d7 Remove inappropriate "Unable to dispose subscription" log msg 2024-10-21 13:29:59 +00:00
John Colvin 5bfbaf9976 fix: Ensure spark config init and login are only performed once
As a static function that could be called from anywhere in the code
(directly or indirectly), 'Configuration.Initialize' was vulnerable to
race bugs. The "Configuration.get<T>()" method, whose calls are
ubiquitous in our code, would initialize config if it hadn't been done
so already. Without a reference to the configServer param, this param
would effectively be ignored/overridden with null.

It's important that login only be performed once, for obvious reasons
(our exes that connect to sparkd are generally designed to process data
for a single user). Furthermore, not every routine that requires a
successful login has a reference to the credentials needed to do it. To
address this, we now pass the ISparkdLoginService singleton to these
routines so they can wait until the singular login task has completed
before they begin.
2024-10-21 13:29:59 +00:00
John Colvin 0435fbee94 Move misplaced log abt initializing query text to appropriate place 2024-10-21 13:29:59 +00:00
John Colvin c5ff2aa03d Assert ViewStreamDatabase.instance is only created once
The instance must be initialized via ViewStreamDatabase.SetGlobalInstance
2024-10-21 13:29:59 +00:00
John Colvin 8d7f1469cc cleanup: Remove unused code from ViewStreamDatabase 2024-10-21 13:29:59 +00:00
John Colvin ecbf9d083c Include subscription id in ds websocket updates 2024-10-21 13:29:59 +00:00
John Colvin de3300de02 fix: Define BoooleanConstant before StringConstant
Otherwise the former masks the latter and prevents it from matching
2024-10-21 13:29:59 +00:00
John Colvin c92f219357 Log event data in websocket open, close, error callbacks 2024-10-21 13:29:59 +00:00
John Colvin 65d8af4939 refactor: Bring back Material DataGrid
Fix the column resize bugs that made it previously unusable
2024-10-21 13:29:59 +00:00
John Colvin 2342670c66 refactor: Improve react webapp state management
* Add queryTextResetTime as part of the CannedQuery state
  (the QueryControl compares the canned query click time with the time of the
  last user input, and applies the text from the most recent change)

* Replace 'isRunning' (bool) with a 'queryState' (string) to reflect the subscription status
  value received from the server. Less indirection this way.

* Replace inappropriate useMemo call w/ useEffect
2024-10-21 13:29:59 +00:00
John Colvin d8bf2d3cda cleanup: Get rid of magic const (subscriptionId) in webapp App.jsx 2024-10-21 13:29:59 +00:00
John Colvin 86e0378008 build: Copy configuration profiles to publish dir 2024-10-21 13:29:59 +00:00
John Colvin c38dc2dc4f cleanup: Remove unnecessary deps from csprojs 2024-10-21 13:29:59 +00:00
John Colvin 6c23240d9c build: Change publish_data_stream.py to publish the sln
We were publishing individual projects as a workaround for the
dependency issue (bug) that caused some projects to incorrectly target
net8.0. The fact that publishing individual projects "just worked" was
probably dumb luck. Now that the underlying issue has been addressed, we
can resume publishing the sln as a whole.
2024-10-21 13:29:58 +00:00
John Colvin a667d486cb dev: Install docker in devcontainer
So we can start various services like sparkd, pubsub, ds publishers, ds
webapp, etc. from inside the devcontainer.
2024-10-21 13:29:58 +00:00
John Colvin 44610a8569 dev: Remove dotnet8 from devcontainer
We'll upgrade to dotnet8 eventually, but now isn't the time (too much
more important work to be done).
2024-10-21 13:29:58 +00:00
John Colvin 7b7fbbaf8b dev: Run devcontainer on host network
So we don't need to worry about publishing the right ports (and don't
need to rebuild the container everytime the list of ports changes).
2024-10-21 13:29:58 +00:00
John Colvin c45ef25a31 fix: Downgrade Microsoft.Extensions.Hosting to 7.0.1
A handful of csprojs were referencing version 8.0.0. Since that version
targets net8.0, I have no idea why it didn't cause the build to fail.
Instead, this framework mismatch led to a mysterious runtime crash with
the following error, despite the dll in question being present in the
build dir:

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The system cannot find the file specified.

It is worth noting that this crash would only happen for exes published
as part of the DataStreamSuite.sln with the "--self-contained" flag. For
example, the Bts.DataStreamSuite.Server exe would always fail if
published via:

dotnet publish --configuration Release --sc --framework net7.0 --runtime linux-x64 <DataStreamSuite.sln>
2024-10-21 13:29:58 +00:00
John Colvin 431ef0ae70 Add HttpsRedirection middleware first in the webapp pipeline
Middleware handlers are invoked in the order in which they are added. Any middleware
that is added before HttpsRedirection may can prevent the request from being redirected.
As of now, only development-specific middleware is added ahead of HttpsRedircetion.
2024-10-21 13:29:58 +00:00
John Colvin a770724de1 build: Copy configuration profiles to build dir
So they are readily available to publish/deploy scripts.
2024-10-21 13:29:58 +00:00
John Colvin c8c464c30e Fix benign typo in Scanner/Parser msbuild targets
The output path referenced a non-existant msbuild metadata prop "RelativeOutputDir"
(the actual prop is called "RelativeDir"). Also, the OutputFile path is relative to the
project dir (the 'MSBuildProjectDir' prop), not the file being included.
2024-10-21 13:29:58 +00:00
John Colvin 5a9930334e fix: Catch exception when creating TcpClient 2024-10-21 13:29:58 +00:00
John Colvin 69ba13f3a1 fix: Catch WebSocketException in DataStreamSubscription 2024-10-21 13:29:58 +00:00
John Colvin 9b0e1642a9 fix: Add null check to NonIncGroupByStream 2024-10-21 13:29:58 +00:00
John Colvin bec2932203 fix: Add null check to TableAccumulator2 2024-10-21 13:29:58 +00:00
John Colvin e76c4d3aaf fix: Add self-signed certificate to Dockerfile for ds webapp 2024-10-21 13:29:58 +00:00
John Colvin 25d2e8048e fix: Make SystemSubscriptionMapPublisher threadsafe
The PubSubState.onTagMapChanged event may not be invoked on
the same thread as doWork.
2024-10-21 13:29:58 +00:00
John Colvin 0e8726c78c fix: Add null check in TimeBasedFilter.cs 2024-10-21 13:29:58 +00:00
John Colvin a1d3c50aef Reduce task wait/timeout code in AsyncTCPConnector 2024-10-21 13:29:58 +00:00
John Colvin d84d993b7d Add a few canned queries to AwsProd.json for ds webapp 2024-10-21 13:29:58 +00:00
John Colvin c58e9b9e96 fix: Copy canned queries to clipboard on click
Instead of trying to update the text directly, which causes the front end
to overwrite the user's changes everytime the data updates from then on.
2024-10-21 13:29:58 +00:00
John Colvin 21240312e7 fix: Convert invalid doubles to nan in ds webapp serializer 2024-10-21 13:29:58 +00:00
John Colvin 5f75a110b7 Increase datagrid maxheight in ds webapp to 1000px 2024-10-21 13:29:58 +00:00
John Colvin 9faf0d69d4 Improve error display in ds webapp 2024-10-21 13:29:58 +00:00
John Colvin c81e84fce1 fix: Dispose existing sub on subscribe req in ds webapp
Even if new sub has parse error. This fixes a bug where the previous
subscription would continue firing and updating the frontend, when it
should just display the error info to the user and cease updates.
2024-10-21 13:29:58 +00:00
John Colvin d1dc6c6e6b fix: Get rid of "UseSpa" calls in webapp Production environment
This was leftover from a misguided attempt to fix a bug that turned out
to be due to an omitted environment var:
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.AspNetCore.SpaProxy
2024-10-21 13:29:58 +00:00
John Colvin aa7dda3dca Define webapp specific env vars in generic datastream app deploy script
For now, this makes things easier, as I don't need to write a special script just for the webapp
2024-10-21 13:29:58 +00:00
John Colvin af2536bbb9 Add config profile and Dockerfile args to deploy script 2024-10-21 13:29:58 +00:00
John Colvin b6cb7fcd1a Copy DataStream WebApp 'dist' to 'wwwroot' in deploy script 2024-10-21 13:29:58 +00:00
John Colvin bda7052e40 Tweak DataGrid style in DataStream WebApp 2024-10-21 13:29:58 +00:00