pinsetter disablement

James Bowes jbowes at redhat.com
Mon Aug 8 12:14:12 UTC 2011


On Fri, Aug 05, 2011 at 05:51:05PM -0400, jesus m. rodriguez wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> My initial approach was to add a candlepin.pinsetter.enable
> config, then check that in CandlepinContextListener:
> 
>   if (config.getBoolean(ConfigProperties.ENABLE_PINSETTER)) {
>     pinsetterListener = injector.getInstance(
>       PinsetterContextListener.class);
>     pinsetterListener.contextInitialized();
>   }
> 
> This seemed so elegant. Clearly I was wrong, it breaks all
> the async jobs including refresh pools.
> 
> Next idea was to check the config property in PinsetterKernel.
> 
>   public void startup() throws PinsetterException {
>     try {
>       scheduler.start();
>       if (config.getBoolean(ConfigProperties.ENABLE_PINSETTER)) {
>         configure();
>     ...
>   }
> 
> When the config is set to false, this would keep pinsetter
> running enough to execute async jobs, by basically ignoring
> all the configured tasks. So far so, good right? Wrong again,
> this would also disable the CancelJobJob rendering job
> cancellation useless.
> 
> The only option I see seems very kludgey, it would be to
> check the config in the configure() method of PinsetterKernel.
> If false, schedule ONLY the CancelJobJob as the only long
> running task. This will allow job cancellation to work
> as well as async jobs, but disables all other jobs.
> 
>   private void configure() {
>     ...
>     if (config.getBoolean(ConfigProperties.ENABLE_PINSETTER)) {
>       // schedule CancelJobJob nothing else.
>     }
>     ...
> 
> Thoughts? Any other ideas?

This seems correct to me. async jobs and the canceljobjob are very
special cases; in fact, if we were comfortable with ensuring that the
canceljob call would always happen on the pinsetter node running the job
to be cancelled, I'd rather just replace it with a synchronous call,
rather than a job scheduling.

> 
> jesus
> 
> - -- 
> jesus m. rodriguez          | jesusr at redhat.com
> principal software engineer | irc: zeus
> red hat systems management  | 919.754.4413 (w)
> rhce # 805008586930012      | 919.623.0080 (c)
> +---------------------------------------------+
> |   "Those who cannot remember the past       |
> |    are condemned to repeat it."             |
> |                        -- George Santayana  |
> +---------------------------------------------+
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk48ZckACgkQvJZ57YntiYNWoACeMJwOBTrdFuPLCVK5mZmJ7iKg
> N7MAoLavjKkKaJDTX01eYbIjx6wqop67
> =i+KN
> -----END PGP SIGNATURE-----
> _______________________________________________
> candlepin mailing list
> candlepin at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/candlepin

-James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/candlepin/attachments/20110808/ca80ad7d/attachment.sig>


More information about the candlepin mailing list