Skip to content

Timeout::timeout not throwing exception when timeout period reaches #1050

@navaneeth

Description

@navaneeth

/tmp/loop.sh

#!/bin/sh
while :
do
    sleep 1
done

Now start the above script from a Ruby script.

/tmp/test.rb

require 'timeout'
begin
    Timeout::timeout(1) {
        `/tmp/loop.sh`.chomp
    }
rescue Exception => e
    puts 'inside rescue'
rescue Error => e1
    puts "inside error"
end

Execute the above script in a JRuby ScriptingContainer.

ScriptingContainer container = new ScriptingContainer();
container.runScriptlet(PathType.ABSOLUTE, "/tmp/test.rb");

The rescue block is not getting executed. Tested this with MRI and it works well there.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions