Skip to content

Commit

Permalink
Fix emp run lockup in 0.13 (#1125)
Browse files Browse the repository at this point in the history
In 0.13, stdout/stderr were split using the stdcopy package.
Unfortunately, this doesn't play well with streamhttp.Heartbeat, which
sends null characters and causes the emp client to lockup.

This removes the heartbeat, since it's mostly unecessary, and causes
other weird side effects (e.g. if you're using tmux, the pain will get
"active" because it thinks there's output).

If using an ELB in front of the Empire daemon, the best thing to do is
set a high idle timeout (maximum is 60 minutes) to prevent emp run
sessions with no output from being killed. This is already the default
recommendation in docs/cloudformation.json.
  • Loading branch information
ejholmes committed Apr 18, 2018
1 parent 053c578 commit b042daa
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions server/heroku/processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ package heroku
import (
"fmt"
"net/http"
"time"

"github.com/remind101/empire"
"github.com/remind101/empire/pkg/heroku"
"github.com/remind101/empire/pkg/hijack"
"github.com/remind101/empire/pkg/stdcopy"
streamhttp "github.com/remind101/empire/pkg/stream/http"
"github.com/remind101/empire/pkg/timex"
"github.com/remind101/empire/server/auth"
)
Expand Down Expand Up @@ -111,8 +109,6 @@ func (h *Server) PostProcess(w http.ResponseWriter, r *http.Request) error {
Header: header,
}
defer stream.Close()
// Prevent the ELB idle connection timeout to close the connection.
defer close(streamhttp.Heartbeat(stream, 10*time.Second))

opts.Stdin = stream

Expand Down

0 comments on commit b042daa

Please sign in to comment.