1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-26 06:50:09 +03:00

B #4867: CommandManager terminate reading threads (#4886)

This commit is contained in:
Vlastimil Holer 2020-06-05 13:18:02 +02:00 committed by GitHub
parent e1086b9838
commit 5549872f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,13 +179,23 @@ private
i.write stdin_data
i.close
out = [out_reader.value, err_reader.value, t.value]
# blocking wait for process termination
t.value
# if reader threads are not dead yet, kill them
[out_reader, err_reader].each do |reader|
next unless reader.status
reader.join(0.1)
reader.kill
end
mutex.lock
terminator.kill
raise terminator_e if terminator_e
out
# return values
[out_reader.value, err_reader.value, t.value]
}
end