dCache / dcache

dCache - a system for storing and retrieving huge amounts of data, distributed among a large number of heterogenous server nodes, under a single virtual filesystem tree with a variety of standard access methods
https://dcache.org
291 stars 136 forks source link

qos fails with `Attribute is not defined: QOS_POLICY` #7678

Open kofemann opened 1 month ago

kofemann commented 1 month ago

Found in log files of prod system.

 java.lang.IllegalStateException: Attribute is not defined: QOS_POLICY
         at org.dcache.vehicles.FileAttributes.guard(FileAttributes.java:335)
         at org.dcache.vehicles.FileAttributes.getQosPolicy(FileAttributes.java:777)
         at org.dcache.qos.services.engine.provider.PolicyBasedQoSProvider.fetchRequirements(PolicyBasedQoSProvider.java:136)
         at org.dcache.qos.services.engine.provider.PolicyBasedQoSProvider.fetchRequirements(PolicyBasedQoSProvider.java:129)
         at org.dcache.qos.local.clients.LocalQoSRequirementsClient.fileQoSRequirementsRequested(LocalQoSRequirementsClient.java:81)
         at org.dcache.qos.services.engine.handler.FileQoSStatusHandler.fileQoSStatusChanged(FileQoSStatusHandler.java:470)
         at org.dcache.qos.services.engine.handler.FileQoSStatusHandler.lambda$handleAddCacheLocation$0(FileQoSStatusHandler.java:195)
         at org.dcache.util.BoundedExecutor$Worker.run(BoundedExecutor.java:247)
         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
         at java.base/java.lang.Thread.run(Thread.java:829)

Casuse:


        FileAttributes attributes = descriptor.getAttributes();
        if (attributes.isDefined(FileAttribute.QOS_POLICY) && attributes.getQosPolicy() == null) {
            /*
             * This is a lazily discovered change, so
             * as a matter of consistency it calls for removal
             * of the pnfsid from the engine's tracking tables.
             */
            engineDao.delete(update.getPnfsId());
            return super.fetchRequirements(update, descriptor);
        }

        return fetchRequirements(update, descriptor);
    }

    @Override
    public FileQoSRequirements fetchRequirements(FileQoSUpdate update, FileQoSRequirements descriptor)
          throws QoSException {
        FileAttributes attributes = descriptor.getAttributes();
        String name = attributes.getQosPolicy();

When policy is not defined, then fetchRequirements is called, which invokes attributes.getQosPolicy() TheString name = attributes.getQosPolicy();` called when

khys95 commented 1 week ago

reviewing

khys95 commented 1 week ago

@kofemann did you mean to finish that sentence? Otherwise, I dont think it makes sense