manticore request timeout for "sync" call not working
I have an implementation like this below when using manticore:
require 'manticore'
default_conf = {
stale_check: true,
check_connection_timeout: 15000,
retry_non_idempotent: true,
request_timeout: 8,
socket_timeout: 8,
connect_timeout: 8
}
url = 'http://localhost:60004'
client = Manticore::Client.new(default_conf)
def get_timeout_manticore(client, url)
start = Time.now
begin
resp = client.get(url).body
puts "Timeout at: #{Time.now - start}"
puts resp
rescue StandardError => e
puts "Timeout at: #{Time.now - start}"
puts e.message
end
end
get_timeout_manticore(client, url)
python script below
import socket # Import socket module
import time
port = 60004 # Reserve a port for your service.
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
s.bind(('localhost', port)) # Bind to the port
s.listen(5) # Now wait for client connection.
print('Server listening....')
while True:
conn, addr = s.accept() # Establish connection with client.
print('Got connection from', addr)
data = conn.recv(1024)
print('Server received', repr(data))
filename='youfilleout.txt'
f = open(filename,'rb')
l = f.read(10)
while l:
time.sleep(2)
conn.send(l)
print('Sent ',repr(l))
l = f.read(10)
f.close()
print('Done sending')
conn.send('Thank you for connecting')
conn.close()
- When I run against my local server, the "request_timeout" does not seems to be used. I may be using manticore in the wrong way. Or something does not look directly observable.
Edited by schanjr
