Skip to content

Can't set headers after sent error #1

@rragan

Description

@rragan

monitr works fine when I run jMeter with 1 user against our app. When I try to increase the number of concurrent users I rapidly get this error:

Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:692:11)
at ServerResponse.res.setHeader (/x/web/STAGE2LP39/walletexpnodeweb/node_modules/express/node_modules/connect/lib/patch.js:63:22)
at next (/x/web/STAGE2LP39/walletexpnodeweb/node_modules/express/node_modules/connect/lib/proto.js:156:13)
at /x/web/STAGE2LP39/walletexpnodeweb/node_modules/express/lib/application.js:121:9
at next (/x/web/STAGE2LP39/walletexpnodeweb/node_modules/express/node_modules/connect/lib/proto.js:129:23)
at /x/web/STAGE2LP39/walletexpnodeweb/node_modules/async/lib/async.js:229:13
at /x/web/STAGE2LP39/walletexpnodeweb/node_modules/async/lib/async.js:116:25
at /x/web/STAGE2LP39/walletexpnodeweb/node_modules/async/lib/async.js:24:16
at /x/web/STAGE2LP39/walletexpnodeweb/node_modules/async/lib/async.js:226:17
at /x/web/STAGE2LP39/walletexpnodeweb/node_modules/async/lib/async.js:513:34

it appears to be due to the interception of the resp.end in lib/monitor.js

I don't know the timing considerations but I'm guessing there is some sort of timing issues around the patched intercept. Sorry I don't have much more to go on. Merely doing the require of monitr is enough to cause the problem. No monitor.start() needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions