Right now, files are just edited, without any form of file locking, which will create problems when tasks are ran simultaneously. We will need to perform locking, flock() will probably be sufficient.
Right now, files are just edited, without any form of file locking, which will create problems when tasks are ran simultaneously. We will need to perform locking, flock() will probably be sufficient.
Comments
Comment #1
adrian commentedThis is implemented in dev-dns as part of the new 'data_store' config classes.
We maintain a set of conditional includes that we manage via the API, adding and removing records from it.
The data stores themselves offer locking, and the locks are used in such a way that we dont generate the config files
based on the data stores unless we are in possession of the write lock on the data store.
because of how this is implemented, if 2 files try to write the same file, it will wait for the process that got the lock first
to save the final object to disc, and acquiring the lock for itself and integrating the newly updated information.
marking as fixed.