duplicate port create requests to neutron by compute

Bug #1267649 reported by ashwin raveendran
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Aaron Rosen

Bug Description

When quantum server is slow in responding to the port create requests (30 seconds or more) we are seeing duplicate port requests being made for the same operation. This is related to the value set for the quantum_url_timeout parameter (30 seconds by default) and by increasing the value we get duplicate port requests only for those quantum requests taking longer than the new timeout value.
It appears that the quantum client is retrying the request on timeouts and is an error to do it for POST which is non-idempotent and in this case creates duplicate ports. Further investigation of the problem shows that this is coming from the httplib2 library which retries requests on socket time out. https://code.google.com/p/httplib2/issues/detail?id=109

Tags: loadimpact
Aaron Rosen (arosen)
Changed in neutron:
assignee: nobody → Aaron Rosen (arosen)
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Sudheendra Murthy (sudhi-vm) wrote :

There is a retry logic in httplib2 used by neutron that automatically retries requests. One instance when this kicks in is: client makes a connection —> issues request to the server —> server takes too long to respond (if busy) —> client socket timesout waiting for response and client goes for a retry. The end result is that the request may get processed twice at the server. There is a parameter RETRIES used in _conn_request(…) defined in __init__.py. This parameter is not configurable, hard-coded to 2.

One possible way to deal with this is to increase the timeout value (which is configurable) to a larger value. The default is 30 seconds and increasing it to larger value helps. This will not solve the issue, but could make it less likely to occur.

Here are Google references to the retry logic in httplib2:
https://code.google.com/p/httplib2/issues/detail?id=109
https://groups.google.com/forum/#!msg/google-api-python-client/VE1d7a7Wevg/elmt1MDsjmAJ
http://httplib2.googlecode.com/hg/doc/html/libhttplib2.html

Revision history for this message
Ravi Chunduru (ravivsn) wrote :
Revision history for this message
Ravi Chunduru (ravivsn) wrote :

In addition to it, I agree we need to set httplib2 RETRIES to 1 and leave the retry logic with neutron client.

Changed in neutron:
milestone: none → juno-1
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

Right now neutron client uses requests library, not httplib2, so it may only apply to old client.

Revision history for this message
Rossella Sblendido (rossella-o) wrote :

This was fixed by https://review.openstack.org/#/c/65840/ no idea why this bug's status is not showing it

Changed in neutron:
status: Confirmed → Fix Committed
tags: added: performance
removed: duplicate ports
tags: added: loadimpact
removed: performance
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.