Hey Silvio,

are you sure this change is necessary?

The proposed change is in the UpdateErrataCacheCommand's updateErrataCache 
method. This method is called only from the UpdateErrataCacheAction's doExecute 
method. Couple of line above the updateErrataCache call we check whether orgId 
is null and in case so, the updateErrataCache method won't be called at all.

UpdateErrataCacheEvent's orgId may:
- either be null - in that case the updateErrataCache method won't be called
- or be not null Long - actually in all places we set orgId to an 
UpdateErrataCacheEvent object, we use the orgId of an existing organization 
like:

        uece.setOrgId(orgIn.getId());
        uece.setOrgId(user.getOrg().getId());

so the organization object has to exist.

So, what is the motivation of this change?
(The only scenario I can imagine is, that the errata cache event will be queued 
and its organization gets deleted before the background errata cache action 
gets executed.)


Regards,
--
Tomas Lestach
Red Hat Satellite Engineering, Red Hat


----- Original Message -----
> From: "Silvio Moioli" <smoi...@suse.de>
> To: spacewalk-devel@redhat.com
> Sent: Monday, September 9, 2013 8:27:56 AM
> Subject: [Spacewalk-devel] [PATCH] UpdateErrataCacheCommand: log an error     
> when orgId is incorrect
> 
> See attached patch.
> 
> Previously a NPE would be generated, but since the stack trace is not
> very useful as it can only go back until run(), it only polluted test
> outputs. I think that logging the error makes more sense in this
> case.
> 
> Regards,
> --
> Silvio Moioli
> SUSE LINUX Products GmbH
> Maxfeldstraße 5, 90409 Nürnberg Germany
> 
> 
> 
> _______________________________________________
> Spacewalk-devel mailing list
> Spacewalk-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-devel

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to