mlogger db_get_record() errors after switching subruns

Issue #281 resolved
dd1 created an issue
09:07:22.018 2020/08/30 [Logger,INFO] db_get_record(0) status 320

09:07:22.018 2020/08/30 [Logger,INFO] Fixing ODB "/Logger/Channels/0/Settings" struct size mismatch (expected 1976, odb size 1744)

I see these errors each time mlogger switches subruns. Probably caused by mlogger writing a new filename which changes the odb string size which causes a mismatch in record length. will be fixed by removing this use of db_get_record. K.O.

Comments (4)

  1. Stefan Ritt

    The problem was introduced in commit https://bitbucket.org/tmidas/midas/commits/50cef30c42cc68edfe48c223695e2cb60d7d3c15 when the line

    db_set_value_string(hDB, log_chn->settings_hkey, "Current filename", &tmpstr);
    

    replaced the previous

    db_set_value(hDB, log_chn->settings_hkey, "Current filename", str, 256, 1, TID_STRING);

    The old code kept the string size at 256, while the new changes the string size in the ODB to the string length. This of course breaks any usage of db_open_record() which relies on fixed sting sizes.

    So any introduction of db_set_value_string() should be carefully checked if that string is used in any db_open_record(), and only be implemented after db_open_record() have been replaced with the new odb++ API.

  2. dd1 reporter

    actually there is no breakage in mlogger - there is no db_open_record() against this string, so the string size changes, then db_get_record1() changes it back. K.O.

  3. Stefan Ritt

    These warnings for each run become annoying. So I changed back db_set_value_string to db_set_value for the moment until we have a better solution. Feel free to resolve this issue.

  4. Log in to comment