Skip to content
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

handler error when running benchmark #1965

Open
3 tasks done
jcreigno opened this issue Nov 22, 2023 · 0 comments
Open
3 tasks done

handler error when running benchmark #1965

jcreigno opened this issue Nov 22, 2023 · 0 comments

Comments

@jcreigno
Copy link
Contributor

  • Used appropriate template for the issue type
  • Searched both open and closed issues for duplicates of this issue
  • Title adequately and concisely reflects the feature or the bug

Restify Version: 11.1.0
Node.js Version: v18

Expected behaviour

benchmark should run without any errors.

Actual behaviour

When I run make benchmark I get an error on handlers:

$>make benchmark
...
⠋ Started head/response-json(node:725052) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

AssertionError [ERR_ASSERTION]: Handler [onRequest on GET /] is missing a third argument (the "next" callback) but is not an async function. Middleware handlers can be either async/await or callback-based.Callback-based (non-async) handlers should accept three arguments: (req, res, next). Async handler functions should accept maximum of 2 arguments: (req, res).
    at Chain.add (/home/jcreignou395/Public/node-restify/benchmark/node_modules/restify/lib/chain.js:79:16)
    at forEach (/home/jcreignou395/Public/node-restify/benchmark/node_modules/restify/lib/router.js:211:15)
    at Array.forEach (<anonymous>)
    at Router.mount (/home/jcreignou395/Public/node-restify/benchmark/node_modules/restify/lib/router.js:203:14)
    at Server.serverMethod [as get] (/home/jcreignou395/Public/node-restify/benchmark/node_modules/restify/lib/server.js:1779:33)
    at Object.<anonymous> (/home/jcreignou395/Public/node-restify/benchmark/benchmarks/response-json.js:15:8)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 'Function',
  expected: 'AsyncFunction',
  operator: '=='
}

Node.js v18.18.0
make: *** [Makefile:70 : benchmark] Erreur 1

Repro case

Clean checkout from current master and run make benchmark with node v18.18. I also reproduce the issue with node v20.x

Cause

The next callbacks are missing.

Are you willing and able to fix this?

Yes. I have a PR ready if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant