I needed to change from async RestSharp call ExecuteAsync to a sync call Execute. It tested fine on my Mac but when placed to staging Linux Ubuntu environment the whole program comes to a halt and the Rest call never goes out to the target server.
I have it like this:
- An endless thread taking the items out of queue.
- For each item starting a separate thread ThreadPool.QueueUserWorkItem(new WaitCallback(executor.SendDelta), job);
- public void SendDelta(object data) and within it call to PostToApi, SubmitDelta_Response rsp = RestHelper.PostToApi(_client, "connector/submitDelta", req, _logger);
PostToApi finally calls Execute …
var rsp = client.Execute(request);
Here I stall.
Since the whole solution runs on my Mac (Mojave), but does stall on Linux Ubuntu 16.0.4 LTS I have been suspecting there must be something with how the kernels are doing threading. But come nowhere.