ptoma98 / skytap-cloud-plugin

Repository for Release 2 of the Skytap Plugin
0 stars 0 forks source link

DELETE config fails after ICNR Disconnect #2

Closed tjmilligan closed 10 years ago

tjmilligan commented 10 years ago

ICNR (and likely VPN) tunnel deletion is occurring prior to the DELETE config operation, but the DELETE config is failing as follows:


Delete Configuration

Expanding environment variable ... ConfigData-$BUILD_NUMBER=>ConfigData-17 File: ConfigData-17 was specified without a path. Defaulting path to Jenkins workspace. Expanding environment variable ... ${WORKSPACE}=>/var/lib/jenkins/jobs/API-Network-Failure/workspace User provided file: /var/lib/jenkins/jobs/API-Network-Failure/workspace/ConfigData-17 Checking for any connected networks for configuration id: 1438152 Getting network list for configuration with id: 1438152 HTTP GET Request: GET https://cloud.skytap.com/configurations/1438152/networks HTTP/1.1 Executing Request: GET https://cloud.skytap.com/configurations/1438152/networks HTTP/1.1

HTTP/1.1 200 OK Getting tunnels for network with id: 993374 Adding tunnel: tunnel-906574-1000666 to list. Disconnecting connected networks ... Disconnecting tunnel with id: tunnel-906574-1000666 HTTP DELETE Request: DELETE https://cloud.skytap.com/tunnels/tunnel-906574-1000666/ HTTP/1.1 Executing Request: DELETE https://cloud.skytap.com/tunnels/tunnel-906574-1000666/ HTTP/1.1

HTTP/1.1 200 OK Tunnel tunnel-906574-1000666 was disconnected successfully. Sending delete request for configuration id 1438152 HTTP DELETE Request: DELETE https://cloud.skytap.com/configurations/1438152 HTTP/1.1 Executing Request: DELETE https://cloud.skytap.com/configurations/1438152 HTTP/1.1

HTTP/1.1 422 Unprocessable Entity Request returned an error: The configuration cannot be deleted because another operation is being performed. Please try again in a moment. Failing build step. Build step 'Execute Skytap Action' marked build as failure Finished: FAILURE

I've seen this type of failure occur in my own scripts when DELETEing the ICNR tunnel and then DELETEing the config. I've found that a retry loop with a sleep of 2 seconds, try again and if fail then sleep 4 seconds, try again and if fail sleep 8 seconds, etc. always allows the DELETE config to succeed.

As an experiment, I inserted a hard-coded 10-second sleep after the ICNR DELETE API call and prior to the config DELETE API call and that was sufficient to allow the config DELETE to occur. In times of high system load, though, a retry loop would remedy the situation where hard-coded 10-seconds might not be long enough.