You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "bobbai00 (via GitHub)" <gi...@apache.org> on 2026/06/12 19:50:56 UTC
Re: [PR] fix(access-control-service): include port in computing unit pod URI and use Envoy Gateway for distributed CUs [texera]
bobbai00 commented on code in PR #5629:
URL: https://github.com/apache/texera/pull/5629#discussion_r3405888189
##########
access-control-service/src/main/scala/org/apache/texera/service/resource/AccessControlResource.scala:
##########
@@ -136,12 +138,27 @@ object AccessControlResource extends LazyLogging {
}
// Dynamic Routing Logic
- val workflowComputingUnitPoolName = KubernetesConfig.computeUnitPoolName
- val workflowComputingUnitPoolNamespace = KubernetesConfig.computeUnitPoolNamespace
- val workflowComputingUnitPoolPort = KubernetesConfig.computeUnitPortNumber
-
- val targetHost =
- s"computing-unit-$cuidInt.$workflowComputingUnitPoolName-svc.$workflowComputingUnitPoolNamespace.svc.cluster.local:$workflowComputingUnitPoolPort"
+ // Use the URI persisted for the computing unit (written by the managing
+ // service when the pod is created) as the routing target, so the address is
+ // resolved from a single source of truth instead of being reconstructed
+ // here. Fall back to the conventional in-cluster address if no URI has been
+ // recorded for the unit yet.
+ val cuDao = new WorkflowComputingUnitDao(
+ SqlServer.getInstance().createDSLContext().configuration()
+ )
+ val unit = cuDao.fetchOneByCuid(cuidInt)
+ val recordedUri = Option(unit).flatMap(u => Option(u.getUri)).map(_.trim).filter(_.nonEmpty)
+
+ val targetHost = recordedUri match {
+ case Some(uri) =>
+ logger.info(s"Routing CU $cuidInt to recorded host: $uri")
+ uri
+ case None =>
+ val workflowComputingUnitPoolName = KubernetesConfig.computeUnitPoolName
+ val workflowComputingUnitPoolNamespace = KubernetesConfig.computeUnitPoolNamespace
+ val workflowComputingUnitPoolPort = KubernetesConfig.computeUnitPortNumber
+ s"computing-unit-$cuidInt.$workflowComputingUnitPoolName-svc.$workflowComputingUnitPoolNamespace.svc.cluster.local:$workflowComputingUnitPoolPort"
Review Comment:
Remove this fallback logic. If no URI is presented, refuse the connection to CU.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org