I’m running some stress tests on Genie apps and literally, the first thing that broke the app was a repeated call to abspath
. I’m not sure if this can be improved, but if not, maybe the docs can point to the fact that it opens files. In my case, I just refactored the code to remove the call to abspath
altogether.
2019-02-16 00:23:41:CRITICAL:Main:
Distributed.RemoteException(1,
CapturedException(
Base.IOError("getcwd: too many open files (EMFILE)", -24),
Any[(pwd() at sys.dylib:?, 1),
(abspath at path.jl:325 [inlined], 1),
(#file_path#40(::Bool, ::Function, ::String) at Router.jl:1065, 1),
(file_path at Router.jl:1065 [inlined], 1),
(is_static_file at Router.jl:952 [inlined], 1),
(route_request(::Request, ::Response, ::IPv4) at Router.jl:89, 1),
... etc
(handle_request(::Request, ::Response, ::IPv4) at AppServer.jl:96, 1),
(handle_request(::Request, ::Response) at AppServer.jl:95, 1),
(#14 at macros.jl:108 [inlined], 1),
(run_work_thunk(::##14#17{Request,Response}, ::Bool) at process_messages.jl:56, 1), (#remotecall_fetch#148(::Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::LocalProcess) at remotecall.jl:364, 1), (remotecall_fetch(::Function, ::LocalProcess) at remotecall.jl:364, 1), (#remotecall_fetch#152(::Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Int64) at remotecall.jl:406, 1), (remotecall_fetch(::Function, ::Int64) at remotecall.jl:406, 1), (setup_http_handler(::Request, ::Response) at AppServer.jl:60, 1), (setup_http_handler at AppServer.jl:59 [inlined], 1), (#6 at AppServer.jl:40 [inlined], 1), (handle at Handlers.jl:248 [inlined], 1), (handle(::RequestHandlerFunction{##6#12}, ::Stream{Request,Transaction{TCPSocket}}) at Handlers.jl:271, 1), (#4 at Handlers.jl:339 [inlined], 1), (macro expansion at Servers.jl:352 [inlined], 1), ((::##13#14{##4#5{RequestHandlerFunction{##6#12}},Transaction{TCPSocket},Stream{Request,Transaction{TCPSocket}}})() at task.jl:259, 1)]))