-
-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
Note: it seems that this setting 'idle_timeout' is only used for live documentation browser pages, so it should be safe to change it without affecting users' worksheets' behavior.
This parameter is also used for timing out normal worksheets. So, it is not correct to write it as timeout of the live documentation only. |
Are you sure? The only place I see it being used is here: https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/notebook.py#L1252 Note the |
That is reading it, not setting it. |
Well, you can set it too. I don't remember where. I do use that parameter (i.e. |
Certainly, you can set it, but if it is not read anywhere except the line I mentioned -- which appears to be the case -- then it is not used to time out anything except docbrowser worksheets, i.e. the live documentation, no matter what it is set to. By the way, you can set it by passing it as a parameter to the |
Thinking about it, I think my only objection is to the comment. Saying that |
What's misleading about it? Is it used for anything else other than live documentation? |
It is set from the timeout parameter. Also look at the function here |
In particular: https://github.com/sagemath/sagenb/blob/master/sagenb/notebook/notebook.py#L1254 |
Yes, but that happens only if |
D'oh, you're right, sorry :) |
Note: the commit message of the parent of this commit is incorrect. The timeout variable did control all worksheets, hence this commit.
I don't know enough the notebook code to really review, but this sounds reasonable. That being said, I'd increase the default timeout for live worksheets to 10 minutes (then you have most likely switched to some other task, while spending two minutes thinking or scratching some paper is usual). Thanks for your work on that issue! |
I think this needs a more careful fix, now that you have separated the timeouts.
|
Oops. Sorry, that was so silly of me. The dicts contain the descriptions. |
And for the record, I should mention here my original motivation: my
It's very anoying to type in some stuff, pause for two minutes to Which points to an independent thing: there should be some visual Of course this will be a less crucial feature when it will be possible |
@nthiery, for now, can you just set the timeout yourself in the notebook settings? For example on sagenb.org if we suddenly increase the timeout by a factor of 5, the server load may jump significantly. What we're editing in this pull request is just the default values. Alternatively, if you or ppurka wants to give this positive review, I can put it into sagenb 0.10.6 and immediately put it on the Sage trac. (I screwed up 0.10.5, which now doesn't even load into Sage, haha.)
Please do, but I'm afraid I'm not familiar enough with the notebook to actually implement that... |
|
||
for W in self.__worksheets.values(): | ||
if W.compute_process_has_been_started(): | ||
W.quit_if_idle(timeout) | ||
if W.docbrowser(): | ||
W.quit_if_idle(pub_timeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be doc_timeout
, as well as the line 1253 before it. There is no need for a pub_timeout
since published worksheets are noninteractive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point... I somehow thought that published worksheets could be interactive. Fixed in 7346a9a.
Thanks to @ppurka for pointing out that published worksheets are never interactive anyway.
}, | ||
|
||
'doc_timeout': { | ||
POS : 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this POS
? Shouldn't it be 2 now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, haha. I had POS : 2
for pub_timeout
before we decided that was useless. In practice it doesn't matter, though - these POS
variables are just used for ordering and most of the config entries don't even have a POS
set (which means it defaults to 100
).
'idle_timeout':120, # 2 minutes | ||
|
||
'idle_timeout': 120, | ||
'doc_timeout': 120, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, you are fairly certain that setting doc_timeout
to 600 won't cause any "harm"? :) In that case, we can change it to 600. Let me pull in @jasongrout to find out what his opinion is w.r.t. this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I guess. I thought we increased the timeout a long time ago to avoid the infamous text cell corruption bug. I think the default timeouts should be much longer than 2 minutes, but I haven't looked at the code in a while, so I'm not absolutely certain of the ramifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I have changed it to 600 in the other pull request: kini#1
add options for live documentation timeout to the notebook command
Ok. I have no more problems with this patch. I believe it is good to go. |
Cool, thanks :) |
Note: it seems that this setting 'idle_timeout' is only used for live
documentation browser pages, so it should be safe to change it without
affecting users' worksheets' behavior.