-
Notifications
You must be signed in to change notification settings - Fork 235
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
Resource not release bug #500
Comments
I just ran into this bug today. This is not great when you try to build a reliable system just to figure out that things start to break in your production environment. A temporary workaround is to increase the nofiles ulimit. File descriptor exhaustion is a security issue. I don't think anyone would want to run into a DoS attack and a data loss. The code that sets Here are the steps to reproduce this: 1.) Create a large file of size deno eval 'Deno.writeTextFileSync("payload.txt", "A".repeat(1_048_576))' 2.) Create a import { Application } from "https://deno.land/x/[email protected]/mod.ts";
const app = new Application();
app.use(async (context, next) => {
try {
await context.send({
root: Deno.cwd(),
index: 'payload.txt',
});
} catch {
await next();
}
});
console.log('http://127.0.0.1:8000')
await app.listen({ port: 8000 }); 3.) Observe FD leak after visiting lsof -awp $(pgrep -f issue_500.ts) | grep payload.txt
deno 323386 nekz 16r REG 8,5 1048576 18777583 /home/nekz/git/clone/oak/payload.txt Deno version:
|
The previous changes fixed oakserver/oak#500 but it also polluted the module scope which shadowed globalThis.Response.
in application.ts:
class Application->#handleRequest function:
check out above comments, see if there has this problems.
The text was updated successfully, but these errors were encountered: