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

Startup is loading forever in Firefox #859

Closed
MrDataPsycho opened this issue Jan 18, 2021 · 16 comments
Closed

Startup is loading forever in Firefox #859

MrDataPsycho opened this issue Jan 18, 2021 · 16 comments
Assignees

Comments

@MrDataPsycho
Copy link

Hi,
when starting the Pluto.run() in my default Firefox browser it loads forever. But if I copy the url and secret to my Cromium based browser then the url ones fine. Some time it shows the following message in the console:

  • ###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
    or Sometime
  • Exiting due to channel error.

But no error is printed in the colsole. Is that a problem only with Firefox?

@MrDataPsycho
Copy link
Author

Ok, So now it throws the following warning after I open it in another Cromium based browser.

┌ Warning: Response function to message of type complete failed
└ @ Pluto ~/.julia/packages/Pluto/luIaC/src/webserver/WebServer.jl:359
┌ Warning: Reading WebSocket client stream failed for unknown reason:
│   parentbody =
│    Dict{Any,Any} with 5 entries:
│      "client_id"   => "k7hprv"
│      "body"        => Dict{Any,Any}("query"=>"sq")
│      "request_id"  => "1o0258f"
│      "notebook_id" => "4e19c11a-592b-11eb-0051-e3f24e17a6c3"
│      "type"        => "complete"
│   exception =
│    KeyError: key :k7hprv not found
│    Stacktrace:
│     [1] getindex at ./dict.jl:467 [inlined]
│     [2] putclientupdates! at /home/datapsycho/.julia/packages/Pluto/luIaC/src/webserver/PutUpdates.jl:56 [inlined]
│     [3] (::Pluto.var"#201#203")(::Pluto.ServerSession, ::Dict{Any,Any}, ::Pluto.Notebook; initiator::Pluto.Initiator) at /home/datapsycho/.julia/packages/Pluto/luIaC/src/webserver/REPLTools.jl:81
│     [4] process_ws_message(::Pluto.ServerSession, ::Dict{Any,Any}, ::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at /home/datapsycho/.julia/packages/Pluto/luIaC/src/webserver/WebServer.jl:357
│     [5] (::Pluto.var"#215#225"{Pluto.ServerSession,Base.RefValue{Function}})(::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at /home/datapsycho/.julia/packages/Pluto/luIaC/src/webserver/WebServer.jl:160
│     [6] upgrade(::Pluto.var"#215#225"{Pluto.ServerSession,Base.RefValue{Function}}, ::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}; binary::Bool) at /home/datapsycho/.julia/packages/HTTP/hbs7O/src/WebSockets.jl:160
│     [7] upgrade at /home/datapsycho/.julia/packages/HTTP/hbs7O/src/WebSockets.jl:142 [inlined]
│     [8] (::Pluto.var"#214#224"{Pluto.ServerSession,HTTP.Handlers.Router{Symbol("##260")},Base.RefValue{Function}})(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) at /home/datapsycho/.julia/packages/Pluto/luIaC/src/webserver/WebServer.jl:147
│     [9] handle at /home/datapsycho/.julia/packages/HTTP/hbs7O/src/Handlers.jl:270 [inlined]
│     [10] #4 at /home/datapsycho/.julia/packages/HTTP/hbs7O/src/Handlers.jl:346 [inlined]
│     [11] macro expansion at /home/datapsycho/.julia/packages/HTTP/hbs7O/src/Servers.jl:402 [inlined]
│     [12] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#214#224"{Pluto.ServerSession,HTTP.Handlers.Router{Symbol("##260")},Base.RefValue{Function}}}},HTTP.ConnectionPool.Transaction{Sockets.TCPSocket},HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() at ./task.jl:356
└ @ Pluto ~/.julia/packages/Pluto/luIaC/src/webserver/WebServer.jl:168

@fonsp
Copy link
Owner

fonsp commented Jan 18, 2021

I am not sure what error message you shared in your first message, but it looks like something internal in Firefox, can you instead share the output of the Web Console when the page is frozen? Have a look at these steps: #553 (comment)

@MrDataPsycho
Copy link
Author

MrDataPsycho commented Jan 21, 2021

Hi,Here is the output from dev. console of the browser. When it happen first time the error is little bit different.

socket-died1

Later it continuously happen when working in the notebook.

socket-died2

Let me know thats what you are looking for or you need some thing more. These are from firefox. The other cromium based browser seems fine. Here is the only error throws in a cromium borwser:

load-error-03

@fonsp
Copy link
Owner

fonsp commented Jan 25, 2021

Thanks! Can you do it again, and post multiple screenshots to make sure that we see everything, including the first messages?

(You can ignore the "Failed to load resource: ... 404", that's 'supposed to happen')

@pankgeorg
Copy link
Collaborator

@DataPsycho Hey! I'm trying to reproduce this! can you give some information for OS and Firefox version?
Looking forward!

@pankgeorg
Copy link
Collaborator

pankgeorg commented Jan 28, 2021

Also, this seems to be related to #848.
Related from the web: meteor/meteor#9255

@MrDataPsycho
Copy link
Author

MrDataPsycho commented Jan 28, 2021

Hi @pankgeorg , Its a Mozilla Firefox 84.0.2 and I am running on Linux Mint 20 Ulyana. I will try to create more screen shot it might help.

@MrDataPsycho
Copy link
Author

Hi @pankgeorg
So I just set the Firefox as default browser and start pluto. First of all it was loading for ever. After a while it shows the welcome screen with a notification that there is a new Pluto update, I am using 0.12.18

It start with that following error:
first-incidence

The through another error:
second-incidence

Then I try to open a notebook. Which through following errors:
third-incidence
fourth-insedence

Then I try to open another notebook and it start to reconnect continuously:
fifth-insedence

@pankgeorg
Copy link
Collaborator

Thank you, that is very helpful. In my computer (Windows 10, FF84.0.2 (64-bit)) it kind-of-works, though Firefox does throw this error. Investigating!

@pankgeorg
Copy link
Collaborator

Unfortunately, I can't reproduce this issue at all.
Can you try in private window without extensions and post the txt again?

Thank you!
P

@digital-carver
Copy link

Just as another data point, I can't reproduce it either, on my Firefox 86 on Linux. Pluto startup does take some time (20+ seconds), but there doesn't seem to be any error like the ones posted, except for the 404 error mentioned as 'expected' above.

@fonsp
Copy link
Owner

fonsp commented Mar 21, 2021

@digital-carver This sounds like it's just the waiting time for Julia's JIT compiler. Pluto is written in Julia after all.

@digital-carver
Copy link

I tried Pluto.run(notebook="mynotebookhere.jl", launch_browser=false), waited some time, and copy-pasted the shown URL in a Firefox tab. To my understanding, this would separate the JIT compilation time - which should be finished by the time the URL is pasted - and give us the load time alone. With this setup, a Pluto notebook still takes 20-30 seconds on average to load in Firefox.

During the long loads, 10+ seconds are spent in this near-empty page:
empty tab with "localhost" as loading status.
Then, the page starts loading, with 10 to 20 seconds spent in intermediate stages like this:
Pluto Loading...

I looked at the Network tab in Firefox Dev Tools window, and it looks like early css and js resources are taking 700 to 900 ms each to load:
Network tab beginning
But perhaps more importantly, for some reason the logo and favicon resources take almost 10 seconds each:
Network tab favicon part

The 18.8 seconds load time shown in the bottom half in the last two images counts only the second stage of the loading process, and doesn't include the ten or so seconds spent in the intitial near-empty page mentioned above. Overall, this load took around 30 seconds to load, which is around the average time from many attempts. Page refreshes and moving to other notebooks within the Pluto interface happen relatively quickly (5-6 s), presumably because the resources are cached, but stopping Pluto and loading it in a new session again brings the time back up to 20-30 s.

@pankgeorg
Copy link
Collaborator

This is very helpful @digital-carver. I will try to find the source of the delay and keep you posted!
Thank you for this!

@fonsp
Copy link
Owner

fonsp commented Mar 22, 2021

This does not isolate JIT time, because the request is handled by Julia code, so the first request will trigger JIT. It does not make sense to measure JIT time when trying to optimize frontend loading time.

To isolate JIT, repeat an action on the frontend multiple times, only the first request will trigger JIT on the server. E.g. load the notebook, wait, and then refresh the browser.

@pankgeorg
Copy link
Collaborator

pankgeorg commented May 5, 2021

Closing due to lack of progress - let's continue in #1168 if we have new data

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

4 participants