Skip to content

why does stream response appear to leak file descriptors?

Notifications You must be signed in to change notification settings

dacto/stream-vs-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why does stream implementation seem to leak file descriptors?

stack build
stack exec stream-vs-buffer
# watch our process' file handlers, refreshing every second
lsof -n -r 1 -p "$(pgrep -f stream-vs-buffer)"
firefox localhost:3000/buffer
# notice that three sqlite file handles are opened: *.sqlite3, *.sqlite3-shm, *.sqlite3-wal
# notice that after several seconds, the file handles are closed
firefox localhost:3000/stream
# notice that three sqlite file handles are opened: *.sqlite3, *.sqlite3-shm, *.sqlite3-wal
# notice that after waiting many minutes, the file handles are still open

credits: to keep it simple, most of the code is from Simpler streaming responses

About

why does stream response appear to leak file descriptors?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published