Skip to content

Fix JetBrains IDEs not properly sending heartbeats to Gitpod's server. #11231

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ class GitpodTerminalService(private val session: ClientProjectSession) {
}
}

override fun onPortForwardingEnded(hostPort: Int) {
thisLogger().info("gitpod: Port $hostPort from Supervisor's Terminal " +
"${supervisorTerminal.pid} is not being forwarded anymore.")
}

override fun onPortForwardingFailed(hostPort: Int, reason: String) {
thisLogger().error("gitpod: Failed to forward port $hostPort from Supervisor's Terminal " +
"${supervisorTerminal.pid}: $reason")
Expand Down
47 changes: 47 additions & 0 deletions dev/gpctl/cmd/workspaces-last-heartbeat.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

package cmd

import (
"context"
"fmt"

"github.com/spf13/cobra"

"github.com/gitpod-io/gitpod/common-go/log"
"github.com/gitpod-io/gitpod/ws-manager/api"
)

// workspacesLastHeartbeatCmd get workspace last heartbeat time
var workspacesLastHeartbeatCmd = &cobra.Command{
Use: "last-heartbeat <instanceID>",
Short: "get workspace last heartbeat time",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

conn, client, err := getWorkspacesClient(ctx)
if err != nil {
log.WithError(err).Fatal("cannot connect")
}
defer conn.Close()

instanceID := args[0]

resp, err := client.DescribeWorkspace(ctx, &api.DescribeWorkspaceRequest{
Id: instanceID,
})
if err != nil {
log.WithError(err).Fatal("error during RPC call")
}

fmt.Println(resp.LastActivity)
},
}

func init() {
workspacesCmd.AddCommand(workspacesLastHeartbeatCmd)
}