Open ambirag opened 7 years ago
@mhardin
@ambirag looking at the code, AutomationStatusServlet:82 will only return a 400 if a run with UUID 'AutomationStatusServlet' already exists. I don't remember why that code was even added (to check if a run is already logged with that UUID) and am wondering if it can be removed. I also am confused why you would have a registered run with that UUID locally.
Thoughts?
@mhardin I think we encountered this issue after rerunning a jenkins job that failed after successfully requesting hub to create nodes and failed due to automation failures. When we retried the same job immediately as the hub already had nodes created , we got 400. I remember this is the scenario that we encountered
@ambirag you should not be reusing the UUID when restarting runs. Since this is now a new run, it should have a new UUID (universally unique identifier). If you have multiple runs with the same UUID, you're violating the concept of a unique identifier.
Error code 400 is returned if the required parameters are not passed in But as per this code
log.info(String.format("Legacy server request received. Browser [%s]", browserRequested)); AutomationRunContext context = AutomationContext.getContext(); // If a run is already going on with this browser, return an error code if(context.hasRun(browserRequested)) { response.setStatus(400); return; }
400 is returned if a hub is requested for new nodes with a browser x, but if the hub already got a request with same browser and running, it returns 400.Also if the hub gets a request with same UUID its already running, it returns 400
This is confusing and difficult as in jenkins we exit the job if we get 400 (if parameter missing). But the second 400 and third ones are not bad in the sense you still have hub and nodes and automation can run. Hence we need to return different codes in these circumstances