From 96d65274246a4be88581693f452e6b3bae9fdc5c Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Tue, 4 Jun 2019 19:19:37 -0700 Subject: [PATCH] Add some documentation to Timeout#timeout about possible issues Documentation requested in [Bug #15886]. --- lib/timeout.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/timeout.rb b/lib/timeout.rb index a33bb4ce65..62a35169a4 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -67,7 +67,9 @@ module Timeout # +sec+ seconds, otherwise throws an exception, based on the value of +klass+. # # The exception thrown to terminate the given block cannot be rescued inside - # the block unless +klass+ is given explicitly. + # the block unless +klass+ is given explicitly. However, the block can use + # ensure to prevent the handling of the exception. For that reason, this + # method cannot be relied on to enforce timeouts for untrusted blocks. # # Note that this is both a method of module Timeout, so you can include # Timeout into your classes so they have a #timeout method, as well as