This bug was created by 5556eca5acd46983bff0b38a1ffbc2f07fbaba9f which intended to improve keyring access performance on Windows. A workaround d3d640b9cc98dd0d06b49a2e4d46eb67af96fe29 disabled the caching again.
Maybe a new report would have been in order to fix this but as this task is mentioned in the comment disabling the caching and the commit message I decided it would be better to edit this report.
The original report was:
I have encountered a problem with 2.1.20 writing to my public keyring.
I was using the pre-compiled binaries on Windows 10.
When editing/refreshing keys, or running gpg --check-trustdb, at the
end of the operation the command window gradually fills up with
repeated lines of:-
gpg: waiting for file 'C:/[path]/gnupg/pubring.kbx' to become
accessible ...
These lines keep coming until I close the command window, or CTRL C
then RETURN, or terminate "GnuPG's OpenPGP tool (32 bit)" in Task
Manager.
Oddly, creating new keys does not seem to trigger this (Or else the
problem is intermittent.)
The problem went away when I switched back to GnuPG 2.1.19.