Project

General

Profile

Support #5352

FindManyP failed if there is no association

Added by Tingjun Yang over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Navigation
Target version:
Start date:
02/05/2014
Due date:
% Done:

100%

Estimated time:
Scope:
Internal
Experiment:
MicroBooNE
SSI Package:
art
Duration:

Description

FindManyP failed if there is no association.

%MSG
%MSG-w FailModule:  AnalysisTree:analysistree 05-Feb-2014 13:38:12 CST  run: 1 subRun: 0 event: 5 
Module failed due to an exception
---- LogicError BEGIN
 Invalid FindManyP
 ---- ProductNotFound BEGIN
   getByLabel: Found zero products matching all criteria
   Looking for type: art::Assns<recob::Track,anab::Calorimetry,void>
   Looking for module label: calo
   Looking for productInstanceName: 

 ---- ProductNotFound END
 Attempt to use a FindManyP where the underlying art::Assns product was not found.
---- LogicError END

%MSG

According to Issue #2938, FindManyP should not throw on construction if the Assns is missing.

History

#1 Updated by Christopher Green over 6 years ago

  • Subject changed from FindManyP failed if there is no assiciation to FindManyP failed if there is no association
  • Description updated (diff)
  • Category set to Navigation
  • Status changed from New to Feedback
  • Assignee set to Christopher Green
  • SSI Package art added
  • SSI Package deleted ()

Hi,

Your are correct in your reading of issue #2938: the FindManyP should not throw on construction. However, that is not what is occurring here. The message you see comes from the throwIfInvalid() function, which is called from various FindManyP functions, but not from the constructor. If you attempt to use an invalid FindXXX smart query object, then at the time of use the stored exception from construction is thrown. If you are able to connect a debugger to the process, stop on __cxa_throw (in gdb, that is catch throw) and look at the stack trace. It should show you that the stored exception is being thrown at the point you attempt to use the invalid object, not where it is constructed.

To ensure that the FindManyP is safe for use, you can call the isValid() function immediately after construction to verify validity before attempting to use the object, just as for (e.g.) a Handle.

Let us know if this turns out to be the problem.

#2 Updated by Christopher Green over 6 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 0 to 100

Resolved per email feedback.

#3 Updated by Christopher Green about 6 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF