pinsetter disablement

jesus m. rodriguez jesusr at redhat.com
Fri Aug 5 21:51:05 UTC 2011


-----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?

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-----



More information about the candlepin mailing list