Commit Graph
14371 Commits
Author SHA1 Message Date
John Colvin d0ee371eec refactor: Replace if/else with switch cases 2025-07-24 14:07:58 +00:00
John Colvin f41e222f21 cleanup: Remove over-engineered subcommands
We don't need explicit subcommands to 'run onixs' md (just use config).
2025-07-24 14:07:58 +00:00
John Colvin b041cf6dcb fix: Ensure IDGenerator instance is created before deref 2025-07-24 14:07:58 +00:00
John Colvin 8918e50789 fix: Expand undefined vars to empty string
Bugs (fixed):
  * Md shared memory file names have unexpanded variable: '${BTS_SHARED_MEMORY_PREFIX}'
2025-07-24 14:07:58 +00:00
John Colvin 8e8d79948e fix: Emplace MDConsumerHandle instead of copy assign 2025-07-24 14:07:58 +00:00
John Colvin 890e96e666 cleanup: Remove unnecessary code
Trim includes as well
2025-07-24 14:07:58 +00:00
John Colvin 1a189767f2 improvement: Set SHARED_MEMORY_PREFIX to an environment variable
So we can effectively define it at runtime. We don't want to have to
produce different builds just to change the shared mem prefix.
2025-07-24 13:37:36 +00:00
John Colvin 4db367c7d0 fix: Always prepend proc name to shared mem prefix
Our shared memory model isn't really designed to be shared across
processes. Maybe some day it will.
2025-07-24 13:37:36 +00:00
John Colvin 036fe48f83 cleanup: Remove redundant macro def 2025-07-24 13:37:36 +00:00
John Colvin fae1ca3825 Skip md recording thread loop if no recorders configured to run 2025-07-24 13:37:36 +00:00
John Colvin be20b95281 cleanup: Trivial whitespace cleanup in Protobuf.cmake 2025-07-24 13:37:36 +00:00
John Colvin de7a7843ef build: Clean up data_files cmake proj (support --target clean) 2025-07-24 13:37:36 +00:00
John Colvin 20cb708914 fix build: Add ShmSegmentName.cpp to windows client sources 2025-07-24 13:37:36 +00:00
John Colvin 465582fe77 Add api server to docker compose 2025-07-24 13:37:35 +00:00
John Colvin 561f310bf3 cleanup: Remove unnecessary env vars from webapp docker compose 2025-07-24 13:37:35 +00:00
John Colvin 65ecf82119 Change api server ports so they don't conflict w/ ds webapp 2025-07-24 13:35:06 +00:00
John Colvin e273f7bf2f build: Resolve app data dir and shared mem prefix at runtime
We really can't define them at compile time anymore as we build multiple
exes that depend on libspark in the same dir (e.g., spark api server,
pubsub, ds-publisher, webapp, etc.). That means one libspark.so (or dll)
must serve all exes. We should compile a consistent libspark to mitigate
the risk of running an exe with the wrong version (of libspark). For
example, running pubsub with a libspark configured for spark api server,
leftover from an earlier build.
2025-07-24 13:35:06 +00:00
John Colvin 5ebeec4b79 Don't log "initializing spark config" if it has already been initialized 2025-07-23 16:55:55 -04:00
John Colvin 1cd71dfe5f vscode: Add debug cfg for spark api server 2025-07-23 16:55:55 -04:00
John Colvin 8d43616bdf Use dependency injection in spark api server 2025-07-23 16:55:48 -04:00
John Colvin 9545876e97 Add SparkLoggerAdapter for Msft ILogger 2025-07-23 16:45:41 -04:00
John Colvin 0772f3a73e Display exception stack trace w/ 1 call per line in ds webapp 2025-07-23 16:45:41 -04:00
John Colvin f3d2815133 Remove unused ErrorView from ds webapp 2025-07-23 16:45:41 -04:00
John Colvin 97fb19ec13 Propagate ViewStream errors to webapp frontend 2025-07-23 16:45:39 -04:00
John Colvin 7401b90486 Add ErrorChanged event to propagate DataStream exceptions 2025-07-23 16:39:28 -04:00
John Colvin f5c2537b26 Set columns to empty array rather than null in ds webapp
If no data has been received. Since the 'columns' property was marked
'required', this eliminates a warning that was being logged to console.
2025-07-23 16:34:04 -04:00
John Colvin 993ab27323 Improve alignment/spacing in ds webapp 2025-07-23 16:34:04 -04:00
John Colvin 8e1243696f Remove "BTS Cloud Streams" title from webapp
Space is precious when viewing on phone (tbh, it didn't look that good
anyways).
2025-07-23 16:31:31 -04:00
John Colvin ec37426c35 fix: Ensure md-publisher waits for pubsub and sparkd
Bugs (fixed):
  * md-publisher silently fails if it tries to connect before those services are "ready".

The Docker compose "depends_on" property ensures sparkd and pubsub
containers are up, but doesn't prevent startup race bugs (e.g., if
md-publisher and pubsub start around the same time, and md-publisher
tries to connect before pubsub has started accepting connections). To
address these race conditions, we use a nifty tool called "dockerize"

References:
  * https://github.com/jwilder/dockerize
2025-07-23 16:31:31 -04:00
John Colvin 3d72ee3cc8 Replace ErrorView component w/ robust QueryStatusView 2025-07-23 16:31:31 -04:00
John Colvin 409d650652 Fix typos in query button theme 2025-07-23 16:31:31 -04:00
John Colvin c51225b98f fix: Don't assert on exception in BooleanExpression.evaluate
Bugs (fixed):
  * DataStream WebApp Server sometimes crashes when the user enters a
    bad query.
2025-07-23 16:31:31 -04:00
John Colvin 3bb153ea4a Change VITE_DATASTREAM_WEBSOCKET_URL to localhost 2025-07-23 16:31:31 -04:00
John Colvin c4ac7a4166 Assert that local ip address is successfully obtained 2025-07-23 16:31:31 -04:00
John Colvin 07fcee15f6 improvement: Resolve hostnames when comparing ip addrs
So we can to configure pubsub routes by hostname or ipv4 (ipv6 hasn't been
tested yet...so we should assume it doesn't work).
2025-07-23 16:31:31 -04:00
John Colvin ac9c407f64 Assert TcpConnection endpoint matches expected 2025-07-23 16:31:31 -04:00
John Colvin f1a7d23893 Fix typo in log msg (was missing interpolation '$') 2025-07-23 16:31:31 -04:00
John Colvin edc18b15c2 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.
2025-07-23 16:31:31 -04:00
John Colvin 8ee7fa99b5 fix: Format PubSubRoute as json in log msgs
It was previously using the default ToString, which simply returns the type name
2025-07-23 16:29:07 -04:00
John Colvin aa6a09c47f build: Upgrade packages (deps) in DataStreamTests 2025-07-23 16:29:06 -04:00
John Colvin 7014898f1f cleanup: Remove unused ViewStreamDatabase config 2025-07-23 16:29:06 -04:00
John Colvin 2cdd394745 vscode: Add PubSubServer debug cfg to skip build 2025-07-23 16:29:06 -04:00
John Colvin 3c0c082dd1 deploy: Add datastream services to Docker compose 2025-07-23 16:27:41 -04:00
John Colvin af693ee229 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.
2025-07-23 16:13:26 -04:00
John Colvin 10270854f2 refactor: Run RemoteQueryManager as an IHostedService
This paradigm more accurately represents the RemoteQueryManager as a
Service that can be started/stopped.
2025-07-23 16:13:26 -04:00
John Colvin 14715f7ea7 Remove inappropriate "Unable to dispose subscription" log msg 2025-07-23 16:13:26 -04:00
John Colvin 2a1161a41b 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.
2025-07-23 16:13:26 -04:00
John Colvin 2879967d6a Move misplaced log abt initializing query text to appropriate place 2025-07-23 16:12:57 -04:00
John Colvin 1fc8afd6af Assert ViewStreamDatabase.instance is only created once
The instance must be initialized via ViewStreamDatabase.SetGlobalInstance
2025-07-23 16:12:57 -04:00
John Colvin be35726582 cleanup: Remove unused code from ViewStreamDatabase 2025-07-23 16:12:57 -04:00