Opened 2 years ago

Closed 2 years ago

#28661 closed defect (fixed)

macOS SageMath.app wait for wrong message, significantly delaying notebook launch

Reported by: gh-maverickwoo Owned by:
Priority: minor Milestone: sage-9.0
Component: notebook Keywords:
Cc: jhpalmieri, slelievre Merged in:
Authors: Frédéric Chapoton Reviewers: Maverick Woo
Report Upstream: N/A Work issues:
Branch: e708071 (Commits, GitHub, GitLab) Commit: e7080715b1b05bc03be2aa97c16460ed23b9a54f
Dependencies: Stopgaps:

Status badges

Description

https://github.com/sagemath/sage/blob/854f9764d14236110b8d7f7b35a7d52017e044f8/src/mac-app/AppController.m#L150-L151 needs to be updated.

150:                         " grep --line-buffered -i 'ipython notebook is running at' |"
151:                         " grep --line-buffered -o http://.*",

This code waits for the message ipython notebook is running at and expects the token to be on the same line.

However, the log file (~/Library/Logs/sage.log) no longer conforms to this. The message has changed and the token is on the next line. Example from version 8.9:

[I 20:31:00.976 NotebookApp] The Jupyter Notebook is running at:
[I 20:31:00.976 NotebookApp] http://localhost:8888/?token=cc2c728ae01f2c3851df1a413a9661f17ca3301b15a9f6e8

The consequence of this mismatch is a very long wait when launching Sage notebook using the bundled app.

I believe we can use

grep -i --context 1 'jupyter notebook is running at' | grep -o http://.*

to obtain the token instead.

Change History (7)

comment:1 Changed 2 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/28661
  • Cc jhpalmieri slelievre added
  • Commit set to e7080715b1b05bc03be2aa97c16460ed23b9a54f
  • Status changed from new to needs_review

Here is the proposed fix, please test and approve.


New commits:

e708071fix for mac-app

comment:2 Changed 2 years ago by gh-maverickwoo

Thanks! I do not have a way to build and test this, but I do believe this fix would work based on a simulation (cat ~/Library/Logs/sage.log | grep -i --context 1 'Notebook is running at' | grep -o http://.* correctly extracts the URL on my mac.)

comment:3 Changed 2 years ago by chapoton

I guess you could dare to set the ticket to "positive review". It cannot become worse than before.

comment:4 Changed 2 years ago by jhpalmieri

I support this.

comment:5 Changed 2 years ago by chapoton

So please gh-maverickwoo, fill the "Reviewers" field in the ticket with your full real name and set the status to 'positive review', if you want.

comment:6 Changed 2 years ago by gh-maverickwoo

  • Reviewers set to Maverick Woo
  • Status changed from needs_review to positive_review

Thanks!

comment:7 Changed 2 years ago by vbraun

  • Branch changed from u/chapoton/28661 to e7080715b1b05bc03be2aa97c16460ed23b9a54f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.