Skip to content

Commit c3f17e9

Browse files
committed
touchups
1 parent 79c4711 commit c3f17e9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

daemon/internal/newrelic/integration/transaction.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"os"
1717
"os/exec"
1818
"path/filepath"
19+
"time"
1920

2021
"github.com/newrelic/newrelic-php-agent/daemon/internal/newrelic/log"
2122
)
@@ -117,7 +118,7 @@ func CgiTx(src Script, env, settings map[string]string, headers http.Header, ctx
117118
},
118119
},
119120
Valgrind: ctx.Valgrind,
120-
Timeout: 60*time.Second,
121+
Timeout: ctx.Timeout,
121122
}
122123
tx.handler.Env = append(tx.handler.Env,
123124
"SCRIPT_FILENAME="+scriptFile,

daemon/internal/newrelic/integration/valgrind.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ func (tx *ValgrindCLI) Execute() (http.Header, []byte, error) {
4141
// valgrind reports to their tests in the same way we use the appname
4242
// to link the transaction data. Failing that, perhaps we could use
4343
// the valgrind process's pid instead.
44+
//
45+
// We prevent concurrent invocations by disallowing valgrind when
46+
// the threads argument is greater than 1. Previously, we used the
47+
// commented out locks below. This was changed to allow subprocesses
48+
// (i.e. curl) to run without deadlocking.
4449
//valgrindMu.Lock()
4550
//defer valgrindMu.Unlock()
4651

@@ -122,12 +127,16 @@ func (tx *ValgrindCGI) Execute() (http.Header, []byte, error) {
122127
// valgrind reports to their tests in the same way we use the appname
123128
// to link the transaction data. Failing that, perhaps we could use
124129
// the valgrind process's pid instead.
130+
//
131+
// We prevent concurrent invocations by disallowing valgrind when
132+
// the threads argument is greater than 1. Previously, we used the
133+
// commented out locks below. This was changed to allow subprocesses
134+
// (i.e. curl) to run without deadlocking.
125135
//valgrindMu.Lock()
126136
//defer valgrindMu.Unlock()
127137

128138
cmd := valgrind.Memcheck(tx.Valgrind, "--quiet")
129139
cmd.Args = append(cmd.Args, "--xml=yes")
130-
//cmd.Args = append(cmd.Args, "--child-silent-after-fork=no")
131140
cmd.Args = append(cmd.Args, "--xml-socket="+valgrindLn.Addr().String())
132141
cmd.Args = append(cmd.Args, "--")
133142
cmd.Args = append(cmd.Args, tx.handler.Path)

0 commit comments

Comments
 (0)