8000 Moving from streaming manifest approach to SSE + explicit full agent … · coder/coder@3a9f9c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a9f9c8

Browse files
committed
Moving from streaming manifest approach to SSE + explicit full agent reinitialization
Signed-off-by: Danny Kopping <danny@coder.com> # Conflicts: # agent/agent.go # Conflicts: # cli/agent.go
1 parent b60f2f6 commit 3a9f9c8

File tree

14 files changed

+482
-441
lines changed

14 files changed

+482
-441
lines changed

agent/agent.go

Lines changed: 107 additions & 157 deletions
Large diffs are not rendered by default.

agent/agenttest/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"tailscale.com/tailcfg"
2121

2222
"cdr.dev/slog"
23+
2324
agentproto "github.com/coder/coder/v2/agent/proto"
2425
"github.com/coder/coder/v2/codersdk"
2526
"github.com/coder/coder/v2/codersdk/agentsdk"
@@ -97,7 +98,7 @@ func (c *Client) Close() {
9798
}
9899

99100
func (c *Client) ConnectRPC23(ctx context.Context) (
100-
agentproto.DRPCAgentClient24, proto.DRPCTailnetClient23, error,
101+
agentproto.DRPCAgentClient23, proto.DRPCTailnetClient23, error,
101102
) {
102103
conn, lis := drpcsdk.MemTransportPipe()
103104
c.LastWorkspaceAgent = func() {

agent/proto/agent.pb.go

Lines changed: 81 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/proto/agent.proto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ message Timing {
297297

298298
service Agent {
299299
rpc GetManifest(GetManifestRequest) returns (Manifest);
300-
rpc StreamManifests(GetManifestRequest) returns (stream Manifest);
301300
rpc GetServiceBanner(GetServiceBannerRequest) returns (ServiceBanner);
302301
rpc UpdateStats(UpdateStatsRequest) returns (UpdateStatsResponse);
303302
rpc UpdateLifecycle(UpdateLifecycleRequest) returns (Lifecycle);

agent/proto/agent_drpc.pb.go

Lines changed: 9 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

agent/proto/agent_drpc_old.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,3 @@ type DRPCAgentClient23 interface {
4040
DRPCAgentClient22
4141
ScriptCompleted(ctx context.Context, in *WorkspaceAgentScriptCompletedRequest) (*WorkspaceAgentScriptCompletedResponse, error)
4242
}
43-
44-
// DRPCAgentClient24 is the Agent API at v2.4. It adds the StreamManifests RPC. Compatible with
45-
// Coder v2.20+
46-
//
47-
type DRPCAgentClient24 interface {
48-
DRPCAgentClient23
49-
StreamManifests(ctx context.Context, in *GetManifestRequest) (DRPCAgent_StreamManifestsClient, error)
50-
}

agent/reaper/reaper_unix.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package reaper
44

55
import (
6+
"fmt"
67
"os"
78
"os/signal"
89
"syscall"
@@ -29,6 +30,10 @@ func catchSignals(pid int, sigs []os.Signal) {
2930
s := <-sc
3031
sig, ok := s.(syscall.Signal)
3132
if ok {
33+
// TODO:
34+
// Tried using a logger here but the I/O streams are already closed at this point...
35+
// Why is os.Stderr still working then?
36+
_, _ = fmt.Fprintf(os.Stderr, "reaper caught %q signal, killing process %v\n", sig.String(), pid)
3237
_ = syscall.Kill(pid, sig)
3338
}
3439
}

0 commit comments

Comments
 (0)
0