Skip to content

No graceful shutdown / signal handling #8

@dbravender

Description

@dbravender

Priority: Medium

Description

In main.go:57:

server.Run(context.Background(), &mcp.StdioTransport{})

There is no signal handling. A SIGTERM during an scc or syft operation won't clean up temp files or close the syft source gracefully.

Suggested fix

Use signal.NotifyContext with SIGINT/SIGTERM:

ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if err := server.Run(ctx, &mcp.StdioTransport{}); err != nil {
    log.Fatal(err)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions