Copter 4.0.3 Logging not stopping on disarm with LOG_FILE_DSRMROT=1

Reported in Gitter Mission Planner channel 5/26 by @FergalLonergan

LOG_BACKEND_TYPE,1
LOG_BITMASK,163838
LOG_DISARMED,0
LOG_FILE_BUFSIZE,64
LOG_FILE_DSRMROT,1
LOG_FILE_TIMEOUT,10
LOG_MAV_BUFSIZE,8
LOG_REPLAY,0

bin file https://files.gitter.im/549a8813db8155e6700e29e7/oHT0/00000004.BIN

I believe this is fixed by https://github.com/ArduPilot/ardupilot/pull/14338
Worked for me (in SITL) by cherry-picking https://github.com/ArduPilot/ardupilot/commit/115751833b72722cfca0d3324f638d1e7080efb9 from master into copter stable.

what is rotate pending?

It’s a flag which is set when a new log should be started

The patch @kd0aij mentioned is a related bugfix - but I think the issue is the lack of documentation and/or understanding around the HAL_LOGGER_ARM_PERSIST feature: https://github.com/ardupilot/ardupilot/blob/master/libraries/AP_Logger/AP_Logger.cpp#L34

We keep logging for a little while after disarm - sometimes there’s useful data there.

Hi @peterbarker so just to clarify the drone now logs for an extra 15 seconds after the initial disarm and will relog into the previous log if the drone rearms in less than 15 seconds, rather than creating a new log for the new flight.
Has this only been updated to Arducopter 4.0.3 or is it also in 4.0.2?
Is there a mission planner parameter where you can switch off the 15 second delay or set the delay time yourself?
I’m doing volume testing on a drone and we turnaround our flights quite quickly, i’d prefer keep as close to the Master as possible without pulling separate branches just in order to keep the fix we need future-proofed with new releases.

it is in all 4.0 and later releases…it was done last year

you could compile Copter4.0.3 or Copter4.0.4beta with just that one constant changed in AP-Logger if you want…wont impact anyting else in the code