You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
It looks like the issue is that we recently changed config.worker_log_file to config.worker.worker_log_file in synapse/synapse/app/admin_cmd.py however, the config.worker object has no attribute worker_log_file, nor is there any references to a worker_log_file anywhere else in the code. A little digging did uncover that the logging configuration file for a worker will contain a filename/path to a logfile for that worker.
My question is, since we are already checking that the config.worker.worker_log_config exists, do we really also need to check that the log file that it presumably references exists as well? I.e. can we drop that line, or is it necessary to figure out how to extract the reference to the worker log file from the worker_log_config and check for it when this is the only place that reference will be used? I spent some time trying to do just that and couldn't figure it out, which led me to wonder if it isn't necessary in the first place.
Has this script been broken since 2019? Surely we'd have noticed sooner...
seems like it has, and nobody at element uses it. If we're going to have it, we should probably have some CI to check it keeps working (like we do for the port_db script).
Okay excellent. I will write a test case to keep an eye on this functionality going forwards, fix this issue, and hopefully fix anything else that might have broken in the interval.
Activity
dklimpel commentedon Sep 28, 2021
When I am ty to fix it by removing this line:
synapse/synapse/app/admin_cmd.py
Line 190 in 8aaa4b7
I get this new error:
@erikjohnston Do you have a hint to fix it? Is it a missing import?
H-Shay commentedon Oct 1, 2021
It looks like the issue is that we recently changed
config.worker_log_filetoconfig.worker.worker_log_fileinsynapse/synapse/app/admin_cmd.pyhowever, theconfig.workerobject has no attributeworker_log_file, nor is there any references to aworker_log_fileanywhere else in the code. A little digging did uncover that the logging configuration file for a worker will contain a filename/path to a logfile for that worker.My question is, since we are already checking that the
config.worker.worker_log_configexists, do we really also need to check that the log file that it presumably references exists as well? I.e. can we drop that line, or is it necessary to figure out how to extract the reference to the worker log file from theworker_log_configand check for it when this is the only place that reference will be used? I spent some time trying to do just that and couldn't figure it out, which led me to wonder if it isn't necessary in the first place.DMRobertson commentedon Oct 5, 2021
Indeed, but I think this goes back further than the recent changes you mention (#10897?).
Running
the first two hits are bb7fdd8 and 6a85cb5. The former is part of Patrick's PR; the latter is part of (the pleasingly-numberered) #5678 from 2019.
Has this script been broken since 2019? Surely we'd have noticed sooner...
I think so. 6a85cb5 seems to be removing
log_fileconfigurations. And in e484101 we explicitly said "this option is gone".So yeah, my vote is to drop that line.
DMRobertson commentedon Oct 5, 2021
(Though as @dklimpel notes, there might be more fixing required afterwards.)
richvdh commentedon Oct 5, 2021
seems like it has, and nobody at element uses it. If we're going to have it, we should probably have some CI to check it keeps working (like we do for the port_db script).
H-Shay commentedon Oct 5, 2021
Okay excellent. I will write a test case to keep an eye on this functionality going forwards, fix this issue, and hopefully fix anything else that might have broken in the interval.