fix(iris): handle scheme in actor proxy upstream URL#4157
Conversation
The iris backend registers endpoints with the http:// scheme (e.g. http://10.164.0.11:63143), but the proxy unconditionally prepended http://, producing a malformed URL. Use the address as-is when it already contains a scheme. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc5c51f2da
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ) | ||
|
|
||
| upstream_url = f"http://{address}/iris.actor.ActorService/{method}" | ||
| base = address if address.startswith("http") else f"http://{address}" |
There was a problem hiding this comment.
Detect scheme using '://' before treating endpoint as URL
The new address.startswith("http") check misclassifies valid bare host:port endpoints whose hostname begins with http (for example http-worker:9000) as already-schemed URLs. In that case the proxy builds http-worker:9000/iris.actor..., which parses with scheme http-worker instead of HTTP and causes upstream forwarding to fail. This is a regression from the previous behavior for a subset of bare addresses; checking for "://" (or parsing scheme explicitly) avoids the false positive.
Useful? React with 👍 / 👎.
Two issues prevented ProxyResolver from working with real iris jobs: 1. The iris backend registers endpoints with http:// scheme (e.g. http://10.164.0.11:63143), but the proxy unconditionally prepended http://, producing a malformed URL. 2. Remove namespace from ProxyResolver — callers pass the full actor name as registered in the endpoint registry. This avoids a mismatch where the client would send a short name but the actor server expects the full namespaced path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3f6556a to
5dae088
Compare
## Summary - The iris backend registers actor endpoints with a full URL including scheme (e.g. `http://10.164.0.11:63143`), but the actor proxy unconditionally prepended `http://`, producing a malformed `http://http://...` URL that fails with "Name or service not known" - Use the address as-is when it already contains a scheme; prepend `http://` only for bare `host:port` addresses ## Test plan - [x] Existing `test_actor_proxy.py` tests pass (bare `host:port` path still works) - [ ] Verify proxy works end-to-end with a running zephyr job after controller redeploy 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Rafal Wojdyla <ravwojdyla@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
http://10.164.0.11:63143), but the actor proxy unconditionally prependedhttp://, producing a malformedhttp://http://...URL that fails with "Name or service not known"http://only for barehost:portaddressesTest plan
test_actor_proxy.pytests pass (barehost:portpath still works)🤖 Generated with Claude Code