I would like to know how ruby on rails requests works. What happens if I make a XHR request to an action of a controller on Ruby on Rails but before it finishes I reload the page, is the action cancelled or the action executes all method despite the client not receiving the response? I would like to know because from my method I am creating a tcp connection to another server to run some scripts but before the method finishes I have to close that connection manually, so I have detected that some tcp connections are kept opened, I think it is because sometimes the requests are cancelled before they finish and the part of the method where closes the tcp connections are not beign run.