Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/server-parity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ on:
- tests/Unit/ServerParityOperatorMetricsContractTest.mjs
- tests/Unit/ServerParityActivityLeaseRenewalContractTest.mjs
- tests/Unit/ServerParityServiceCatalogContractTest.mjs
- tests/Unit/ServerParitySystemMetricsContractTest.mjs
- tests/Unit/ServerParityNamespaceDeleteContractTest.mjs
- tests/Unit/ServerParityWaitingHistoryContractTest.mjs
- tests/Unit/ServerParityTaskRetryContractTest.mjs
Expand Down Expand Up @@ -86,6 +87,7 @@ on:
- tests/Unit/ServerParityOperatorMetricsContractTest.mjs
- tests/Unit/ServerParityActivityLeaseRenewalContractTest.mjs
- tests/Unit/ServerParityServiceCatalogContractTest.mjs
- tests/Unit/ServerParitySystemMetricsContractTest.mjs
- tests/Unit/ServerParityNamespaceDeleteContractTest.mjs
- tests/Unit/ServerParityWaitingHistoryContractTest.mjs
- tests/Unit/ServerParityTaskRetryContractTest.mjs
Expand Down Expand Up @@ -1504,7 +1506,7 @@ jobs:
-e COMPOSER_HOME=/tmp/composer -v "$PWD:/source" -w /source "$image" \
install --working-dir=scripts/conformance/server-parity --no-interaction --no-progress
docker run --rm --user=1000:1000 --entrypoint node -v "$PWD:/source:ro" -w /source \
"$image" --test tests/Unit/ServerParityRunnerTest.mjs tests/Unit/ServerParityCooperativeContractTest.mjs tests/Unit/ServerParityChildCancellationContractTest.mjs tests/Unit/ServerParityScheduleContractTest.mjs tests/Unit/ServerParityVisibilityContractTest.mjs tests/Unit/ServerParityAdmissionContractTest.mjs tests/Unit/ServerParityRoleTokenContractTest.mjs tests/Unit/ServerParityWorkerDeregistrationContractTest.mjs tests/Unit/ServerParitySearchAttributeContractTest.mjs tests/Unit/ServerParityWorkerListingContractTest.mjs tests/Unit/ServerParityWorkerReplacementContractTest.mjs tests/Unit/ServerParityPatchDeploymentContractTest.mjs tests/Unit/ServerParityWaitingHistoryContractTest.mjs tests/Unit/ServerParityTaskRetryContractTest.mjs tests/Unit/ServerParityPublishedPatchContractTest.mjs tests/Unit/ServerParityPublishedPatchTransportTest.mjs tests/Unit/ServerParityRecordFileTest.mjs tests/Unit/ServerParityLateWorkflowCompletionContractTest.mjs tests/Unit/ServerParityStorageTestContractTest.mjs tests/Unit/ServerParitySchedulePoliciesContractTest.mjs tests/Unit/ServerParitySignalsBeforeWorkerContractTest.mjs tests/Unit/ServerParityScheduleCatalogContractTest.mjs tests/Unit/ServerParityOperatorMetricsContractTest.mjs tests/Unit/ServerParityActivityLeaseRenewalContractTest.mjs tests/Unit/ServerParityServiceCatalogContractTest.mjs tests/Unit/ServerParityNamespaceDeleteContractTest.mjs > parity-evidence/comparator-tests.txt
"$image" --test tests/Unit/ServerParityRunnerTest.mjs tests/Unit/ServerParityCooperativeContractTest.mjs tests/Unit/ServerParityChildCancellationContractTest.mjs tests/Unit/ServerParityScheduleContractTest.mjs tests/Unit/ServerParityVisibilityContractTest.mjs tests/Unit/ServerParityAdmissionContractTest.mjs tests/Unit/ServerParityRoleTokenContractTest.mjs tests/Unit/ServerParityWorkerDeregistrationContractTest.mjs tests/Unit/ServerParitySearchAttributeContractTest.mjs tests/Unit/ServerParityWorkerListingContractTest.mjs tests/Unit/ServerParityWorkerReplacementContractTest.mjs tests/Unit/ServerParityPatchDeploymentContractTest.mjs tests/Unit/ServerParityWaitingHistoryContractTest.mjs tests/Unit/ServerParityTaskRetryContractTest.mjs tests/Unit/ServerParityPublishedPatchContractTest.mjs tests/Unit/ServerParityPublishedPatchTransportTest.mjs tests/Unit/ServerParityRecordFileTest.mjs tests/Unit/ServerParityLateWorkflowCompletionContractTest.mjs tests/Unit/ServerParityStorageTestContractTest.mjs tests/Unit/ServerParitySchedulePoliciesContractTest.mjs tests/Unit/ServerParitySignalsBeforeWorkerContractTest.mjs tests/Unit/ServerParityScheduleCatalogContractTest.mjs tests/Unit/ServerParityOperatorMetricsContractTest.mjs tests/Unit/ServerParityActivityLeaseRenewalContractTest.mjs tests/Unit/ServerParityServiceCatalogContractTest.mjs tests/Unit/ServerParitySystemMetricsContractTest.mjs tests/Unit/ServerParityNamespaceDeleteContractTest.mjs > parity-evidence/comparator-tests.txt
docker run --rm --user=1000:1000 --cpus=1 --memory=256m --memory-swap=256m \
--network=none --entrypoint node -v "$PWD:/source:ro" -w /source \
"$image" --test tests/Unit/ServerParityCodecDeadlineLoadTest.mjs > parity-evidence/codec-load-tests.txt
Expand Down
11 changes: 8 additions & 3 deletions docs/rust-server-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,15 @@ Updated October 22, 2026.
These published PHP routes on this tree have no native handler yet, by family.

- **Used by the CLI or Waterline.**
- Namespace delete.
- Standalone activities: list, describe and start.
- `system` metrics (JSON and Prometheus), the repair pass, and external
payload cleanup and its pass.
- The Prometheus metrics summary, the repair pass, and external payload
cleanup and its pass. (Namespace delete is served with the
`namespace-delete` fixture. The JSON `GET|POST /api/system/metrics` is
served with the `system-metrics` fixture: namespace failure, durable-state
and payload counts are exact; native enforces no admission, durable-state
or payload quota, so limits are null and rejections zero, as on an
unconfigured PHP server. Projection drift is server-wide, and native's
only drift source is a run without its summary.)
- Task queue priority and fairness.
- **Worker protocol features.**
- Worker sessions.
Expand Down
1 change: 1 addition & 0 deletions rust/src/runtime/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ impl Runtime {
delegate!(system_health(config: &super::operator_metrics::MetricsConfig) -> Result<(bool, Value)>);
delegate!(operator_dashboard(config: &super::operator_metrics::MetricsConfig, bounded: bool) -> Result<Value>);
delegate!(repair_status() -> Result<Value>);
delegate!(system_metrics() -> Result<Value>);
delegate!(retention_status(limit: i64) -> Result<Value>);
delegate!(retention_pass(limit: i64, run_ids: Vec<String>) -> Result<(Value, bool)>);
delegate!(activity_timeout_status(limit: i64) -> Result<Value>);
Expand Down
11 changes: 10 additions & 1 deletion rust/src/runtime/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ pub fn router(runtime: Runtime) -> Router {
)
.route("/api/system/operator-metrics", get(operator_metrics))
.route("/api/system/health", get(system_health))
.route("/api/system/metrics", get(system_metrics).post(system_metrics))
.route("/api/system/operator-dashboard", get(operator_dashboard))
.route("/api/system/operator-dashboard/bounded", get(bounded_operator_dashboard))
.route(
Expand Down Expand Up @@ -645,6 +646,10 @@ fn named_namespace_operation(method: &str, path: &str) -> bool {
if path == "/api/system/retention/pass" || path == "/api/system/activity-timeouts/pass" {
return method == "POST";
}
// The metrics describe the namespace's own state, read by GET or POST.
if path == "/api/system/metrics" {
return matches!(method, "GET" | "POST");
}
if let Some(path) = path.strip_prefix("/api/workflows/") {
let parts: Vec<_> = path.split('/').collect();
if matches!(
Expand Down Expand Up @@ -704,7 +709,7 @@ fn named_namespace_operation(method: &str, path: &str) -> bool {
| ["workflow-tasks" | "activity-tasks", "poll"]
| ["query-tasks", "poll"]
| ["query-tasks", _, "complete" | "fail" | "status"]
| ["workflow-tasks", _, "complete" | "history" | "heartbeat"]
| ["workflow-tasks", _, "complete" | "fail" | "history" | "heartbeat"]
| [
"activity-tasks",
_,
Expand Down Expand Up @@ -1473,6 +1478,10 @@ async fn activity_timeout_status(
Ok(Json(runtime.activity_timeout_status(limit).await?))
}

async fn system_metrics(Extension(runtime): Extension<Runtime>) -> Result<Json<Value>> {
Ok(Json(runtime.system_metrics().await?))
}

/// PHP answers 503 while a check reports an error.
async fn system_health(Extension(runtime): Extension<Runtime>) -> Result<Response> {
let (unavailable, body) = runtime.system_health(&metrics_config(&runtime)).await?;
Expand Down
1 change: 1 addition & 0 deletions rust/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ mod start_definition;
mod start_request;
mod storage_test;
mod store;
mod system_metrics;
mod system_health;
mod task_failures;
mod task_repair;
Expand Down
8 changes: 2 additions & 6 deletions rust/src/runtime/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1848,12 +1848,8 @@ where
// replay block, without a retry, until an operator repairs the run.
let range_blocked =
range_blocked || (!waiting && super::task_failures::blocks_replay(&body["failure"]));
if !waiting && self.namespace.as_ref() != "default" {
return Err(refuse(
StatusCode::UNPROCESSABLE_ENTITY,
"development_workflow_task_retry_namespace_unqualified",
));
}
// The task is read within the request's namespace, and its retry
// copies the run's namespace.
let mut tx = self.begin().await?;
let task = self.task_row(&mut tx, task_id).await?;
if DB::string(&task, "task_type")? != "workflow" {
Expand Down
Loading
Loading