-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show useful 502 message for not running/existent sandbox #231
Show useful 502 message for not running/existent sandbox #231
Conversation
…rror-indicating-that-the-sandbox-is-not-running-when-e2b-1327
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the DNS is now shared for API and orchestrator. I think it will behave the same, because there's nothing running on 3003 port, but it would be better and cleaner to split it
…rror-indicating-that-the-sandbox-is-not-running-when-e2b-1327
@jakubno split the DNS package between api/ and orchestrator/ , with only the latter having the special "sandbox not found" routing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key Issues
Setting a TTL of 0 can lead to performance issues due to excessive DNS queries; consider using a positive TTL value for caching. The code lacks validation for empty DNS questions, which could result in undefined behavior. Assumptions about the format of q.Name
may cause errors if the expected '-' character is missing; implement validation or safer parsing.
…r (which session proxy uses)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Key Issues
The code fails to handle cases where a sandbox is not found, potentially leading to empty DNS responses and unexpected client behavior, unlike the original code which returned a default IP.
Description
[re-using previous work from @dobrac in #224]
To return a meaningful error during the DNS resolution in API from
client-proxy
we route the traffic to a "dummy" server that serves the exception if the sandbox cannot be found.Per feedback, also split the DNS package between api/ and orchestrator/ , with only the latter having the special "sandbox not found" routing.
Test
✨
Description by Callstackai
This PR introduces a new DNS handling feature that provides a meaningful 502 error message when a sandbox is not running or does not exist. It also refactors the DNS package structure and updates the configuration for the client proxy.
Diagrams of code changes
Files Changed
This PR includes files in programming languages that we currently do not support. We have not reviewed files with the extensions
.conf
. See list of supported languages.