Tirenvi_05/31.Issue/0121.Bug log watchdog false
をテンプレートにして作成
[
Front page
] [
New
|
Page list
|
Search
|
Recent changes
|
Help
]
Start:
** 現象・原因 [#t63c032e]
+ markdownのinsertでreconcileが走る?
+ get_tick()で比較しているバッファが違う
+ last_time の時計が違う
+ monitor off できない
** 対策 [#k1e25438]
- last_tickをバッファ単位かカレント変わったらリセット
-- アクティブなバッファだけ監視すれば良いのでリセットが正...
- 自分自身で変更する場合は抑止
- get_timestampを正しく使う
- config.log.monitor : off で抑止できる様に
** 回避策 [#n29940f9]
- output = "file"
** test case [#m767499a]
**Summary [#f8d0868f]
While typing in a markdown buffer containing tables, the ...
`[TIR][ERROR][log.lua:62] changedtick runaway detected` p...
on nearly every keystroke. The plugin itself keeps workin...
watchdog in `lua/tirenvi/util/log.lua` is false-positiving.
**Root cause [#e85bb1dc]
The watchdog in `monitor()` (`log.lua:50-75`) reports a r...
`b:changedtick` advances by more than 100 between two log...
1s apart. Three problems combine to make it fire during n...
+ '''The plugin's own edits inflate changedtick.''' Auto-...
buffer lines on each keystroke (`state/buffer.lua` → `...
so during continuous typing in a table the tick advanc...
user keystrokes alone. The watchdog ends up flagging t...
normal realignment work.
+ '''Ticks from different buffers are compared.''' `get_t...
''current'' buffer's changedtick, but `last_tick` is a...
a buffer switch, the delta is computed between two unr...
ticks, which can be arbitrarily large.
+ '''`last_time` is shared between two clocks.''' `monito...
`uv.now()` (ms) into `last_time`, while `get_timestamp...
`uv.hrtime()` (ns) into the same variable when `use_ti...
enabled, so the "< 1000" time gate is meaningless in t...
Additionally, the watchdog cannot be disabled: `config.lo...
only suppresses the stats prefix in `get_monitor()`, whil...
runs unconditionally on every `emit()`.
**Steps to reproduce [#ve01f855]
+ `require("tirenvi").setup()` with defaults (log output ...
+ Open a markdown file containing a table.
+ Type continuously inside the table in insert mode.
+ "changedtick runaway detected" notifications appear rep...
**Suggested fix [#ad5b1cbe]
- Track `last_tick` per buffer (or reset it when the curr...
- Exclude ticks consumed by the plugin's own `set_lines` ...
raise the threshold substantially.
- Give `monitor()` its own timestamp variable instead of ...
with `get_timestamp()`.
- Have `monitor()` respect `config.log.monitor` so users ...
**Environment [#x310f90e]
- tirenvi.nvim @ 114417f
- Neovim on macOS (Darwin 25.6.0)
Workaround meanwhile: `setup({ log = { output = "file" } ...
to a log file instead of notifications.
End:
** 現象・原因 [#t63c032e]
+ markdownのinsertでreconcileが走る?
+ get_tick()で比較しているバッファが違う
+ last_time の時計が違う
+ monitor off できない
** 対策 [#k1e25438]
- last_tickをバッファ単位かカレント変わったらリセット
-- アクティブなバッファだけ監視すれば良いのでリセットが正...
- 自分自身で変更する場合は抑止
- get_timestampを正しく使う
- config.log.monitor : off で抑止できる様に
** 回避策 [#n29940f9]
- output = "file"
** test case [#m767499a]
**Summary [#f8d0868f]
While typing in a markdown buffer containing tables, the ...
`[TIR][ERROR][log.lua:62] changedtick runaway detected` p...
on nearly every keystroke. The plugin itself keeps workin...
watchdog in `lua/tirenvi/util/log.lua` is false-positiving.
**Root cause [#e85bb1dc]
The watchdog in `monitor()` (`log.lua:50-75`) reports a r...
`b:changedtick` advances by more than 100 between two log...
1s apart. Three problems combine to make it fire during n...
+ '''The plugin's own edits inflate changedtick.''' Auto-...
buffer lines on each keystroke (`state/buffer.lua` → `...
so during continuous typing in a table the tick advanc...
user keystrokes alone. The watchdog ends up flagging t...
normal realignment work.
+ '''Ticks from different buffers are compared.''' `get_t...
''current'' buffer's changedtick, but `last_tick` is a...
a buffer switch, the delta is computed between two unr...
ticks, which can be arbitrarily large.
+ '''`last_time` is shared between two clocks.''' `monito...
`uv.now()` (ms) into `last_time`, while `get_timestamp...
`uv.hrtime()` (ns) into the same variable when `use_ti...
enabled, so the "< 1000" time gate is meaningless in t...
Additionally, the watchdog cannot be disabled: `config.lo...
only suppresses the stats prefix in `get_monitor()`, whil...
runs unconditionally on every `emit()`.
**Steps to reproduce [#ve01f855]
+ `require("tirenvi").setup()` with defaults (log output ...
+ Open a markdown file containing a table.
+ Type continuously inside the table in insert mode.
+ "changedtick runaway detected" notifications appear rep...
**Suggested fix [#ad5b1cbe]
- Track `last_tick` per buffer (or reset it when the curr...
- Exclude ticks consumed by the plugin's own `set_lines` ...
raise the threshold substantially.
- Give `monitor()` its own timestamp variable instead of ...
with `get_timestamp()`.
- Have `monitor()` respect `config.log.monitor` so users ...
**Environment [#x310f90e]
- tirenvi.nvim @ 114417f
- Neovim on macOS (Darwin 25.6.0)
Workaround meanwhile: `setup({ log = { output = "file" } ...
to a log file instead of notifications.
Page: