incorrect plugin identified for timeout
mcollina opened this issue · comments
Matteo Collina commented
In this following case we identify the wrong plugin in the timeout error:
const Fastify = require('./fastify');
const app = Fastify({ logger: true, pluginTimeout: 1000 });
function myPlugin(fastify, opts) {
fastify.decorate('myPlugin', 'myPlugin');
// we are not calling the callback on purpose
}
app.register(async function a (fastify, opts) {
await fastify.register(myPlugin)
})
app.listen({ port: 3000 }, (err) => {
console.log(err);
})
Specifically, we identify a
as timing out.
This might be an avvio bug.
Matteo Collina commented
Note that there is a crash with that code as well, which is fixed in fastify/avvio#252.