Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bf8c3fc
Added UDS functionality to boss. Can be used in place of TCP ports
bridgetwu33 Oct 4, 2025
37deb89
Merge branch 'open-lambda:main' into main
bridgetwu33 Oct 4, 2025
f9aaffe
Edited UDS to be implemented in worker, undoed changes to boss and co…
bridgetwu33 Oct 8, 2025
9c181bd
Modified workers to use mux for port and UDs, added error channel for…
bridgetwu33 Oct 11, 2025
3d861db
Merge remote-tracking branch 'upstream/main'
Oct 21, 2025
b4b8e07
Reordered handler and server creation
bridgetwu33 Oct 21, 2025
d80187e
Reordered removing sockPath
bridgetwu33 Oct 21, 2025
915dbbc
Changed comments with UDS to UNIX domain socket
bridgetwu33 Oct 21, 2025
3009712
Refactored waiting for signals from error handling channel
bridgetwu33 Oct 22, 2025
33151f8
Renamed shutdown function to WriteFinalStats, changed cleanup
bridgetwu33 Oct 22, 2025
52855e8
Fixed typo
bridgetwu33 Oct 22, 2025
c249633
Fixed shutdown logic
bridgetwu33 Oct 23, 2025
fcadf8f
Fixed commands.go
bridgetwu33 Oct 23, 2025
e808553
Fixed error messages, Main can now return an error, and added panic i…
bridgetwu33 Oct 23, 2025
dd7389e
Changed commands.go to handle main returning nil
bridgetwu33 Oct 23, 2025
4c295da
Fixed err variable
bridgetwu33 Oct 23, 2025
859b865
Modified NewLambdaServer to take in a serveMux
bridgetwu33 Oct 23, 2025
da5c68a
Modified NewSockServer to take in a serveMux
bridgetwu33 Oct 23, 2025
89d0d31
Moved check for nil error
bridgetwu33 Oct 23, 2025
4f7418e
Changed upCmd to return event.Main
bridgetwu33 Oct 29, 2025
1fad99e
Added comment about upCmd behavior to commands.go
bridgetwu33 Oct 29, 2025
ff09938
Moved check for nil error
bridgetwu33 Oct 23, 2025
49f4bb6
Changed upCmd to return event.Main
bridgetwu33 Oct 29, 2025
a157bb9
Added comment about upCmd behavior to commands.go
bridgetwu33 Oct 29, 2025
ac17f02
Merge branch 'main' of github.com:bridgetwu33/open-lambda
bridgetwu33 Oct 29, 2025
b0913ce
Removed unused parameters pidPath and server from WriteFinalStats fun…
bridgetwu33 Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions go/worker/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ func initCmd(ctx *cli.Context) error {
}

// upCmd corresponds to the "up" command of the admin tool.
// If it returns a non-nil error at any point, `urfave/cli` will
// automatically catch it, print the error message to stderr.
// Then we exit the program and return to main, where we call os.Exit(1)
func upCmd(ctx *cli.Context) error {
// get path of worker files
olPath, err := common.GetOlPath(ctx)

if err != nil {
return err
}
Expand Down Expand Up @@ -193,11 +197,8 @@ func upCmd(ctx *cli.Context) error {
return fmt.Errorf("worker still not reachable after 30 seconds: %w", pingErr)
}

if err := event.Main(); err != nil {
return err
}
// server had clean shutdown
return nil
return event.Main()
}

// statusCmd corresponds to the "status" command of the admin tool.
Expand Down
16 changes: 8 additions & 8 deletions go/worker/event/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func PprofCpuStop(w http.ResponseWriter, _ *http.Request) {
}

// Writes final stats and any buffered CPU profile to disk.
func WriteFinalStats(pidPath string, server cleanable) {
func WriteFinalStats() {
statsPath := filepath.Join(common.Conf.Worker_dir, "stats.json")
snapshot := common.SnapshotStats()

Expand Down Expand Up @@ -352,28 +352,28 @@ func Main() error {
go func() {
slog.Info("worker listening on UNIX domain socket", "socket", sockPath)
err := udsServer.Serve(ln)
if err != nil && err != http.ErrServerClosed {
errorChannel <- fmt.Errorf("UNIX domain socket server failed: %w", err)
}
// Serve() always returns a non-nil error, so this should not be reachable
if err == nil {
slog.Error("Serve returned nil", "server", "uds")
panic(err)
}
if err != nil && err != http.ErrServerClosed {
errorChannel <- fmt.Errorf("UNIX domain socket server failed: %w", err)
}
}()

// start serving on the HTTP Server
go func() {
slog.Info("worker listening on TCP", "port", port)
err := portServer.ListenAndServe()
if err != nil && err != http.ErrServerClosed {
errorChannel <- fmt.Errorf("Port server failed: %w", err)
}
// Serve() always returns a non-nil error, so this should not be reachable
if err == nil {
slog.Error("Serve returned nil", "server", "tcp")
panic(err)
}
if err != http.ErrServerClosed {
errorChannel <- fmt.Errorf("Port server failed: %w", err)
}
}()

// wait for either kill signal or error from server
Expand Down Expand Up @@ -407,7 +407,7 @@ func Main() error {
}
}

WriteFinalStats(pidPath, s)
WriteFinalStats()

// return an error if we shutdown due to server error
if !isKillSignal {
Expand Down
Loading