newrelic / infra-integrations-sdk

New Relic Infrastructure Integrations SDK
Apache License 2.0
44 stars 23 forks source link

Jmx closed connection [possible bug] #278

Closed paologallinaharbur closed 2 years ago

paologallinaharbur commented 2 years ago

After a timeout of a single query it seems that all the connections are closed:

func TestJmxNoTimeoutQuery(t *testing.T) {

    defer Close()

    if err := openWait("", "", "", "", openAttempts); err != nil {
        t.Error(err)
    }

    if _, err := Query(cmdTimeout, 0); err != nil {
        t.Error(err)
    }
    if _, err := Query(cmdBigPayload, timeoutMillis); err != nil {
        t.Error(err)
    }
}

This produces:

    jmx_test.go:146: timeout waiting for query: timeout
    jmx_test.go:149: EOF

While the first one is expected, the second one it is not, since the timeout is of the single query and there is no reason to fail the second one. We had users complaining for this behaviour.

However, this could be expected behaviour if we close the connection and we prefer to fail since the library is not able to "trash" the result for the timeout query that is not interesting anymore. Further investigation is needed