luakit / luakit

Fast, small, webkit based browser framework extensible by Lua.
https://luakit.github.io/
GNU General Public License v3.0
2.1k stars 251 forks source link

Session files are 0 in size; :wq does not close #697

Open jknoos opened 6 years ago

jknoos commented 6 years ago

To reproduce this issue, first i delete .local/share/luakit/session. Then I do ":wq" in Luakit but Luakit does not close. It does create a 0-length "session" file in .local/share/luakit. In the scenario that this happens, recovery_session is also 0 in size. This happens sometimes after opening several tabs. Closing them until there is only one left does not resolve the issue.

aidanholm commented 6 years ago

That's... quite odd. I can't reproduce this.

What system are you on? What luakit version are you using? Are you using LuaJIT? Are there any error messages or warnings in the log? Does luakit seem to work normally after :wq doesn't exit, or does it stop responding?

:wq will refuse to quit if some module wants to keep the browser open, but will show an error in this case. The session writing code is pretty simple, and seems guaranteed to produce non-empty files.

jknoos commented 6 years ago

Arch Linux with luakit-git from AUR, just reinstalled recently.

Luakit does work normally after wq.

I haven't found a reliable way to reproduce it yet but added some logging in the save function in session.lua. I noticed the session backup file keeps growing even when I close tabs. Is this intended for tab history or is it a leak? I wonder if the saving fails when the buffer exceeds some size. Right now it's at 600 kb after a day. I'll monitor the logs.

aidanholm commented 6 years ago

Thanks for the info.

Yes, closed tabs are supposed to be saved in the session; the number of tabs to save is controlled by the undoclose.max_saved_tabs setting, and is 100 by default.

jknoos commented 6 years ago

I had been using an rc.lua in ~/.config/luakit since a previous version and since replacing that with userconf.lua containing only my changes the issue has not appeared, so it may have had something to do with that.