mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: switch agent gone response from 502 to 404 (#23090)
When a user creates a workspace, opens the web terminal, then the workspace stops but the web terminal remains open the web terminal will retry the connection. Coder will issue a HTTP 502 Bad Gateway response when this occurs because coderd cannot connect to the workspace agent, however this is problematic as any load balancer sitting in front of Coder sees a 502 and thinks Coder is unhealthy. The main change is in https://github.com/coder/coder/pull/23090/changes#diff-bbe3b56ed3532289481a0e977867cd15048b7ca718ce676aae3f3332378eebc2R97, however the main test and downstream tests are also updated. This PR changes the response to a [HTTP 404](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/404) after internal discussion. <img width="1832" height="1511" alt="image" src="https://github.com/user-attachments/assets/0baff80d-bb98-4644-89cd-e80c87947098" /> Created with the help of Mux, reviewed and tested by a human
This commit is contained in:
@@ -1016,7 +1016,7 @@ func Test_ResolveRequest(t *testing.T) {
|
||||
|
||||
w := rw.Result()
|
||||
defer w.Body.Close()
|
||||
require.Equal(t, http.StatusBadGateway, w.StatusCode)
|
||||
require.Equal(t, http.StatusNotFound, w.StatusCode)
|
||||
assertConnLogContains(t, rw, r, connLogger, workspace, agentNameUnhealthy, appNameAgentUnhealthy, database.ConnectionTypeWorkspaceApp, me.ID)
|
||||
require.Len(t, connLogger.ConnectionLogs(), 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user