Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matcher logging is incorrect #7884

Open
chrisburr opened this issue Nov 11, 2024 · 2 comments
Open

Matcher logging is incorrect #7884

chrisburr opened this issue Nov 11, 2024 · 2 comments
Assignees
Milestone

Comments

@chrisburr
Copy link
Member

In #4978 subloggers were added for the matching process however the same DB instance is used for all matching requests meaning the logs are meaningless when multiple matching requests are being processed:

matcher = Matcher(
pilotAgentsDB=self.pilotAgentsDB,
jobDB=self.jobDB,
tqDB=self.taskQueueDB,
jlDB=self.jobLoggingDB,
opsHelper=opsHelper,
pilotRef=pilotRef,
)
result = matcher.selectJob(resourceDescription, credDict)

@fstagni
Copy link
Contributor

fstagni commented Nov 12, 2024

I don't want to move to

matcher = Matcher( 
     opsHelper=opsHelper, 
     pilotRef=pilotRef, 
 ) 
 result = matcher.selectJob(resourceDescription, credDict) 

so maybe I simply remove these lines:

self.pilotAgentsDB.log = gLogger.getSubLogger(f"[{pilotRef}]Matcher")
self.jobDB.log = gLogger.getSubLogger(f"[{pilotRef}]Matcher")
self.tqDB.log = gLogger.getSubLogger(f"[{pilotRef}]Matcher")
self.jlDB.log = gLogger.getSubLogger(f"[{pilotRef}]Matcher")

@chrisburr
Copy link
Member Author

I think the logging is valuable. I haven't thought it through but could you make log a contextvar?

@fstagni fstagni added this to the v8.0 milestone Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants