Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error code 400 returned for two different purpose #15

Open
ambirag opened this issue Jun 14, 2017 · 4 comments
Open

error code 400 returned for two different purpose #15

ambirag opened this issue Jun 14, 2017 · 4 comments

Comments

@ambirag
Copy link

ambirag commented Jun 14, 2017

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

@ambirag
Copy link
Author

ambirag commented Jun 14, 2017

@mhardin

@mhardin
Copy link
Owner

mhardin commented Jun 16, 2017

@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?

@ambirag
Copy link
Author

ambirag commented Jul 6, 2017

@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

@mhardin
Copy link
Owner

mhardin commented Jul 7, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants