You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
doc: Database#busy_timeout= renders without its description (shadowed by alias_method in database.rb) #772
The generated docs show Database#busy_timeout= with no description. Its rdoc comment in ext/sqlite3/database.c ("Indicates that if a request for a resource terminates because that resource is busy, …") is never rendered, on main too, so anything added to that comment is invisible in the published docs. #771 adds text there about holding the GVL and deferring interrupts, which is how this came up.
Cause
lib/sqlite3/database.rb:387:
alias_method:busy_timeout,:busy_timeout=
When RDoc (8.1.0 here) parses this, it creates an undocumented busy_timeout= entry for SQLite3::Database, and that entry takes the place of the C method's documentation.
Checked by running rdoc on subsets of the files:
Files given to rdoc
busy_timeout= description rendered
ext/sqlite3/database.c alone
yes
ext/sqlite3/database.c + lib/sqlite3/pragmas.rb
yes
ext/sqlite3/database.c + lib/sqlite3/database.rb
no
the whole repo (bundle exec rdoc, as rdoc.yml runs it)
no
ext/sqlite3/database.c + lib/sqlite3/database.rbwithout the alias_method line
yes
Suggested fix
Define the alias in C, next to the method, and drop the Ruby alias_method:
With that change, the busy_timeout= description renders, and busy_timeout still appears as "Alias for: busy_timeout=". Runtime behaviour is unchanged, since both define the same alias on SQLite3::Database.
I haven't included this in #771 to keep that PR focused. Happy to open a separate PR if you'd like.
Activity