Bug 603197

Summary: candlepin event generation may not be working as designed
Product: [Community] Candlepin Reporter: wes hayutin <whayutin>
Component: candlepinAssignee: Devan Goodwin <dgoodwin>
Status: RELEASE_PENDING --- QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 0.5CC: bkearney, kbanerje
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
atom feeds working none

Description wes hayutin 2010-06-11 20:12:37 UTC
I may be misunderstanding how the candlepin server should send events.
I *think* candlepin is supposed to send a new unique event for each new unique action from the client.


sm register
sm bind --pool=1
sm unsubscribe all
sm bind --pool=2

I think that would be four separate events, and I should have at least four events in my atom feed.  What appears to happen is that I only get a new atom feed for each type of event.

For example, the same scenario..

sm register  - EVENT GENERATED
sm bind --pool=1 - EVENT GENERATED
sm unsubscribe all - EVENT GENERATED
sm bind --pool=2 - EVENT NOT GENERATED
sm unsubscribe all EVENT NOT GENERATED

Here is my current feed..
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><atom:feed xmlns:atom="http://www.w3.org/2005/Atom"><atom:updated>2010-06-11T16:02:19.852-04:00</atom:updated><atom:entry><atom:title>ENTITLEMENT DELETED</atom:title><atom:published>2010-06-11T16:02:19.852-04:00</atom:published><atom:content><event><entityId>1</entityId><id>5</id><ownerId>1</ownerId><principal>ConsumerPrincipal [ownerId=1, uuid=4fb4c4d3-5afe-4a8d-88a8-416ba64672ce, roles=[CONSUMER]]</principal><target>ENTITLEMENT</target><timestamp>2010-06-11T16:02:19.852-04:00</timestamp><type>DELETED</type></event></atom:content></atom:entry><atom:entry><atom:title>ENTITLEMENT CREATED</atom:title><atom:published>2010-06-11T15:57:27.153-04:00</atom:published><atom:content><event><entityId>1</entityId><id>2</id><ownerId>1</ownerId><principal>ConsumerPrincipal [ownerId=1, uuid=4fb4c4d3-5afe-4a8d-88a8-416ba64672ce, roles=[CONSUMER]]</principal><target>ENTITLEMENT</target><timestamp>2010-06-11T15:57:27.153-04:00</timestamp><type>CREATED</type></event></atom:content></atom:entry><atom:entry><atom:title>CONSUMER CREATED</atom:title><atom:published>2010-06-11T15:55:40.525-04:00</atom:published><atom:content><event><entityId>1</entityId><id>1</id><ownerId>1</ownerId><principal>UserPrincipal [ownerId=1, username=admin, roles=[SUPER_ADMIN]]</principal><target>CONSUMER</target><timestamp>2010-06-11T15:55:40.525-04:00</timestamp><type>CREATED</type></event></atom:content></atom:entry></atom:feed>

This may not be a bug, but I'm opening it just to make sure.

Comment 1 wes hayutin 2010-06-14 21:03:23 UTC
reverified that this is the current behavior.
I ran ntpdate on both server and the client on the latest builds, and still recreated.
commit 66faa874b651741c8203ffa4f97a894ca2c33d11

Comment 2 Devan Goodwin 2010-06-17 12:33:24 UTC
Hey wes, when you say "unsubscribe all", what command are you running?

Comment 3 Devan Goodwin 2010-06-17 12:49:24 UTC
Also what atom URL were you hitting?

Comment 4 Devan Goodwin 2010-06-17 13:03:34 UTC
If you were using the consumer specific URL I think I see the problem. The query is looking for events where the entity ID matches the consumer, but in the case of a bind/unbind the entity ID is actually an entitlement ID. If you consumer has ID 1, the first entitlement will get ID 1, which explains why you're only seeing the first bind.

Good find. Will be a little tricky to solve with our current model, going to have to think on it.

Comment 5 Devan Goodwin 2010-06-22 12:16:43 UTC
Should be fixed in c6a1ebf78c548d22506da59216915d81f487beba.

This code was deployed with 0.0.18.

Comment 6 wes hayutin 2010-07-07 13:42:06 UTC
Created attachment 430068 [details]
atom feeds working

Comment 7 John Sefler 2011-05-04 14:40:24 UTC
Group move of VERIFIED Candlepin component bugs to RELEASE_PENDING