1830 Commits

Author SHA1 Message Date
Andreas Jaeger
d8cde2ae6b Fix post install jobs
The venv environment is used for post install jobs and thus cannot
currently use constraints, use an unconstraint install command for it.

Example failure:
http://logs.openstack.org/b8/b8a70e4aeca83ebefad4b127af71b1bd125efa40/post/zaqar-branch-tarball/d9fe983/

Change-Id: If6e9f85b3a8b15048453bf1177812fb37a8e2d54
2016-06-16 19:50:57 +02:00
Fei Long Wang
b8a70e4aec Add release note for bug 1590173
Change-Id: I80a1d6fb5d5e4413526079c1894153e80207ada1
2016-06-16 11:28:00 +12:00
Jenkins
43255acc3a Merge "Add Queues for api ref" 2016-06-15 03:57:12 +00:00
Fei Long Wang
9a3b0191af Add Queues for api ref
Change-Id: I45566944491d0ddf6d43ad60c3f97d3d7f5aa057
2016-06-15 14:50:41 +12:00
Jenkins
a2eaac82d4 Merge "Use debug instead of warning for pipeline implement error" 2016-06-13 20:10:38 +00:00
Jenkins
7e9e276999 Merge "Add release notes" 2016-06-13 04:27:46 +00:00
Jenkins
b43ff612dd Merge "Make queues lazy in subscriptions" 2016-06-13 04:09:01 +00:00
Eva Balycheva
4c2b7e04db Make queues lazy in subscriptions
Currently queues are lazy on operations with messages, but not with
subscriptions. It means the user is forced to pre-create a queue before
creating a subscription to the queue, which is not very convenient.

Also currently if a queue has a subscription, the subscription will
stay on even if the user will delete the queue. But even if so Zaqar
will still work normally. This is strange that subscriptions can exist
with deleted corresponding queues, but it's impossible to create a
subscription to yet unexising queue.

This patch makes queues lazy also on operations with subscriptions, so
the user will be able to subscribe to yet unexisting queue.

Also this patch modifies tests, to make sure Zaqar's subscriptions
work both with pre-created queues and non-existing queues.

APIImpact
DocImpact
Implements: blueprint lazy-queues-in-subscriptions

Change-Id: I814b503243c4e06e74acc6b709bda4269df889e9
2016-06-12 22:18:45 +00:00
Fei Long Wang
e9dbb19a3a Add release notes
Change-Id: Iecb4c53add040e564f9cf7e1ccb7b44755b3355d
2016-06-10 11:59:43 +12:00
Yatin Kumbhare
989f477459 Use is_valid_ipv6 from oslo.utils
oslo.utils method is_valid_ipv6 catches AddrFormatError exception
in case of invalid ipv6 address. This method is warpper around
netaddr.valid_ipv6 method, and ensure always return boolean value.

Change-Id: Idead014cc53600f599810b849789ea67a3a3f1bf
2016-06-09 19:45:40 +05:30
Jenkins
cb0e04a3f9 Merge "Fix fail of getting claim after claim expire(Redis)" 2016-06-08 23:04:18 +00:00
Fei Long Wang
d30ceae3bd Use debug instead of warning for pipeline implement error
Now pipeline is heavily used in Zaqar for controller, but unfortunately
operators will see a lot of WARNING errors in Zaqar's log because
some of the controllers don't implement one of the methods. That should
be a development details and it's not necessary to expose as WARNING,
otherwise, operators will be scared.

Change-Id: I98c574dc240372627d9e760fc0253c6340a9463f
2016-06-09 07:15:33 +12:00
Jenkins
e3e9f22e3b Merge "Use assertEqual/GreaterEqual/LessEqual" 2016-06-08 14:30:31 +00:00
Thomas Herve
61100fec33 Fix subscription limit per queue
Query for all subscriptions on a given queue by taking into account the
returned marker, if any.

Change-Id: I6b03dd93cabc76d1c91041a896fbb30ac08032f1
Closes-Bug: #1590173
2016-06-08 11:33:45 +02:00
wanghao
e72dc08287 Fix fail of getting claim after claim expire(Redis)
When creating a claim for messages in a queue, after
this claim expires, Zaqar will return service unavailable
when getting the claim.

This happens since claim's id is still listed in set
"<project_id>.<queue_name>.claims" but Zaqar get '[None]'
from claim_id's 'expire' field.

Fix this issue if field value is '[None]' then just return
it and remove it from  set "<project_id>.<queue_name>.claims".

Change-Id: I8602b197903acc1692185e7715a4070814fe1661
Closes-Bug: #1588247
2016-06-07 17:06:10 +08:00
Jenkins
5d1964d96b Merge "Make the notifier max_workers configurable" 2016-06-07 02:45:40 +00:00
Jenkins
088c3f6310 Merge "Show 'age' field in subscriptions (redis)" 2016-06-07 02:21:38 +00:00
Jenkins
5271dd3ae3 Merge "Show 'age' field in subscriptions (mongodb)" 2016-06-07 02:21:27 +00:00
Junyuan Leng
c1f0ac1302 Make the notifier max_workers configurable
Make the max_workers attribute of NotifierDriver configurable.
Now it can be configured using 'max_workers' parameter. Default
value of max_workers is 10.

Co-Authored-By: wangxiyuan<wangxiyuan@huawei.com>
Change-Id: Ice7d12199f8463793951932b48408e7df81440f2
2016-06-07 09:17:40 +08:00
Jenkins
754aaa4c6e Merge "Rename notification/task to notification/tasks" 2016-06-06 23:40:18 +00:00
Jenkins
0fa59f4dab Merge "Define context.roles with base class" 2016-06-06 22:49:07 +00:00
Eva Balycheva
897424af77 Show 'age' field in subscriptions (redis)
We recently fixed subscriptions and now they are expirable resources as
they should be.

This patch adds 'age' field to subscription resource representation
which is exposed to the user and defined in redis driver.

This patch also removes existing 'expires' field, because:
1. The 'expires' field is missing in mongodb's subscription resource
representation. (But age field was also missing until a recent patch).
2. The 'expires' field has int (timestamp) format, which is not human
readable.
3. Other Zaqar's expirable resources show 'age' and 'ttl' fields instead
of showing 'expires' field.
4. There is no need in 'expires' field when 'age' and 'ttl' fields are
exposed to the user.

This change in unlikely to affect backward compatibility, because
subscription expirations started to work only recently.

Closes-Bug: 1552845
APIImpact
DocImpact
Change-Id: I18f908b2f137bd4b8e5b3d3275063a1d37942093
2016-06-07 01:40:21 +03:00
Eva Balycheva
3b32dfb1ec Show 'age' field in subscriptions (mongodb)
We recently fixed subscriptions and now they are expirable resources as
they should be.
But now, unlike messages and claims, they don't show their age, so it's
impossible for the user to know when the particular subscription will
expire.

This patch adds 'age' field to subscription resource representation
returned from mongodb driver. Tests are modified to make them check also
'age' field.

Partial-Bug: 1552845
APIImpact
DocImpact
Change-Id: I5eb6a6a267161ec7ee6a7cda094dd55960520069
2016-06-06 22:32:00 +00:00
Jenkins
d01946c40f Merge "Support Tempest test as gate job" 2016-06-06 09:59:53 +00:00
Jenkins
9a1f1e682a Merge "Fix fail of claim after some message expire(Redis)" 2016-06-06 09:18:43 +00:00
Jenkins
e27f5416c9 Merge "Add reserved metadata check" 2016-06-06 09:08:34 +00:00
wangxiyuan
682eae09e9 Add reserved metadata check
Now,Zaqar will always return "max_messages_post_size"
and "default_message_ttl" when get a queue's metadata.
So users can't know whether these values are in db or
not. Then if they take the "replace" or "remove" action
to update the queue's metadata when these two values are
not in db, they will get an error: "can not update(remove)
non-exist metadata".

So we should check them before the queue update action.

Change-Id: Ia97e80a406c8321c7e8d0aa2652023049e5ee4c0
Closes-bug: #1570160
2016-06-06 10:02:50 +08:00
Fei Long Wang
c5640b866b Support Tempest test as gate job
Now Zaqar isn't using Tempest for jenkins gate checking, which is
a missing. This patch fixes it by using Tempest's all-plugin to
run Zaqar's Tempest cases in tree.

Change-Id: I7e10a5b218b60eea47a96d36ebeb4029d33e7edd
2016-06-06 01:48:12 +00:00
wangxiyuan
8e5be21524 Avoid multi-threading problem with sql backend
Now zaqar's sql backend always use only one connection
to db. It will lead an multi-thread problem:
pymysql.err.InternalError) Packet sequence number wrong

So we should use session in sqlalchemy to avoid this happen.

Change-Id: I84e2f9899e141aed151f7c06fc4b1f603481886e
Closes-bug: #1588117
2016-06-06 09:46:53 +08:00
Eva Balycheva
48f3e9f9a2 Fix fail of claim after some message expire(Redis)
If some messages in Redis are already expired, it's impossible to claim
any new messages.

Zaqar internally catches this error from running "claim_messages.lua":
"ResponseError: Error running script: @user_script:59: user_script:59:
attempt to compare nil with number". And returns 503 response code to
the user.

This happens because if some message is expired (it's <message_id>
record was automatically deleted from database), it's ID is still listed
in set "<project_id>.<queue_name>.messages" and Zaqar uses this ID. In
this case on attempt to get some values from <message_id>'s fields, it
gets 'nil' values.

This patch makes Zaqar check if returned field values from <message_id>
record are 'nil'. If values are not 'nil', process the record normally.
If values are 'nil', remember message ID. In the end of the script
"claim_messages.lua" garbage collect all such message IDs, because it's
a good opportunity to do so.

Closes-Bug: 1548135
Change-Id: Iedd2b82f6da30dd38bfdbb837bf9d0d4c282e222
2016-06-02 09:03:28 +00:00
Jenkins
454d4acf01 Merge "Changed assertTrue(isinstance()) to assertIsInstance." 2016-05-31 06:48:54 +00:00
Jenkins
4c01f71c3e Merge "Always use pip constraints" 2016-05-31 03:48:17 +00:00
Jenkins
86419a6883 Merge "Init commit to add API ref in tree" 2016-05-31 02:54:41 +00:00
Fei Long Wang
437c26aaee Always use pip constraints
Depends-On: Idffbdc9325868a3dcd6a9bd7f90f030fd52ee0dc
Change-Id: I9f86fa6df33003de213edac8f6da5faad674aa54
2016-05-31 02:41:47 +00:00
Jenkins
dfa5493a73 Merge "Improve the log to avoid unexpected ERROR" 2016-05-30 06:50:38 +00:00
Fei Long Wang
da4009d8ad Init commit to add API ref in tree
This patches adds the basic architecture to adopt api ref in tree
and a new tox command to build api ref for testing.

A new api ref gate job will be added to verify the format which
will be tracked by another commit against project-config.

blueprint: api-ref-in-tree

Change-Id: Idffbdc9325868a3dcd6a9bd7f90f030fd52ee0dc
2016-05-30 15:40:10 +12:00
OpenStack Proposal Bot
4f1bff4e6a Updated from global requirements
Change-Id: I22d7d7542f296f303172997604945c950a9a08cf
2016-05-29 23:12:36 +00:00
Ronald Bradford
c3af668480 Define context.roles with base class
In f383bd2973c58c5272504603e4f9dddd55c5bb68, oslo.context (2.2.0)
added roles support in the context itself. This passes roles to
super()__init__.

Change-Id: I0535728846006c0ad26c75a8fe36071e96e96f71
2016-05-28 06:47:06 +00:00
Junyuan Leng
e007e474e6 Use run() wrapper instead of connection.execute()
The sqlalchemy driver uses a run() wrapper instead of directly
using the connection.execute() method. I changed the other use
of connection.execute() to run() for consistency.

Closes-Bug: #1469207

Change-Id: I0cfe043f31e8bebe26c983c734e0db754e122fbe
2016-05-28 03:11:00 +00:00
Fei Long Wang
6250cde275 Improve the log to avoid unexpected ERROR
When notification pipeline and pooling are both enabled, the method
'post' of NotifierDriver will be called two times. One for normal
SubscriptionController and one for pooling.SubscriptionController.
So a check was added to avoid the notifition is sent two times, but
unfortunately an unintentional error was introduced. This patch fixes
it by refactoring the condition checking.

Change-Id: Ie22748e86a50b7d91f24707b0c5a3ab718f005a2
2016-05-28 02:21:10 +00:00
Fei Long Wang
ebc6721b4f Rename notification/task to notification/tasks
We're using zaqar.notification.tasks to look for the notifier
driver by stevedore, so this patch just rename the package
name to keep consistence. No impact for end user and migration.

Change-Id: I7694af4dbc4f73703e429560fb0a1457f3e1193a
2016-05-27 10:04:20 +12:00
Fei Long Wang
c3ebf0d12c Replace tempest-lib with tempest.lib
Since tempest-lib is deprecated for future bug-fixes and code changes
in favor of tempest, so Zaqar's tempest code need to be changed
accordingly. See
http://docs.openstack.org/developer/tempest-lib/readme.html

Change-Id: I095e8ea3fe09fa9b4e81c6a25abe200b5d5fcd15
2016-05-26 21:57:17 +00:00
wanghao
437c2fe567 Refactor zaqar/storage/utils.py to respect DRY
Refactor the code merged to fix the py34 issue,
let it follow the DRY principle.

Depends-on: I6da301dc4935ec8e4254d71ca93036f3d8db2bcf
Change-Id: Iaa0768e795e172649787dc6d26722848b5d732ee
Closes-Bug: #1584958
2016-05-25 10:13:50 +00:00
Jenkins
dd0e12513a Merge "remove verbose option in devstack plugin" 2016-05-23 22:49:32 +00:00
ZhiQiang Fan
7e87adeecf remove verbose option in devstack plugin
This option is deprecated in Mitaka and has been removed in Newton,
and its default value is True already. Let's remove it.

Change-Id: I167713165bd96a4ccd423976f8fcad5ff8fc399c
ref: https://review.openstack.org/#/c/314573/
2016-05-23 22:00:07 +00:00
wanghao
e6d975fd10 Fix falcon confilct in requirements.txt
Since hook feature has removed after 1.0.0, using
middleware instead of it, but for the compatibility
with old version, we support them both now.

Closes-Bug: #1583358

Change-Id: Ie182017d982efd727c63634b2a168dadd41711e4
2016-05-23 21:59:43 +00:00
Fei Long Wang
58e8429e0f Fix py34 gate job
Add a configuration wrapper to avoid reentrant call to __getattr__()
in copy.copy(conf) on Python 3.x which is causing Zaqar's py34 gate job
failure randomly. The code is copied from Cinder, see the similar fix
in Cinder: https://review.openstack.org/#/c/280241/

Co-Authored-By: wangxiyuan<wangxiyuan@huawei.com>
Co-Authored-By: Wang Hao<wanghao749@huawei.com>

Change-Id: I627b96f00e5b05993b8f4f586ea216214d5f1a5f
2016-05-23 17:36:02 +00:00
Jenkins
d1491c82f8 Merge "Trivial: remove openstack/common in flake8 exclude list" 2016-05-15 03:49:47 +00:00
Thomas Herve
3f15c0bee1 Move to falcon middleware
Instead of using the now removed hook feature of falcon, let's use
the middleware feature.

NOTE: Though the test is changed. But actually it's not correct since
the unicode test with a running zaqar server will return 404 instead
of 400. But it's out of the scope of this fix. Will fix it in a
following patch.

Co-Authored-By: Fei Long Wang <flwang@catalyst.net.nz>

Closes-Bug: #1581189
Change-Id: I7e8e97b73ec3e245580f07e62442caf0395d5745
2016-05-13 19:34:40 +12:00
sharat.sharma
d744f813a0 Changed assertTrue(isinstance()) to assertIsInstance.
Change-Id: I0cb3e994ce813ceedaad91d441c20e7e67946c39
Closes-Bug: #1268480
2016-05-12 16:19:53 +05:30