Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use file locking mechanisms for multi-process environments #53

Open
rfc2822 opened this issue Jul 12, 2016 · 1 comment
Open

Use file locking mechanisms for multi-process environments #53

rfc2822 opened this issue Jul 12, 2016 · 1 comment

Comments

@rfc2822
Copy link
Contributor

rfc2822 commented Jul 12, 2016

There might be environments where the key store file might be shared either

  • by multiple MTMs in multiple processes, and/or
  • by MTM and other libraries.

In both cases, thread synchronization within MTM is not enough. So I suggest to use file locking (if available on the platform and for the key store location) to prevent concurrent file access: a shared lock for reading and an exclusive lock for writing.

@rfc2822 rfc2822 changed the title Use file-locking mechanisms for multi-process environments Use file locking mechanisms for multi-process environments Jul 12, 2016
@rfc2822
Copy link
Contributor Author

rfc2822 commented Jul 14, 2016

Maybe there should also be a mechanism to notify MTMs in other processes when the key store has changed (so that keyStoreUpdated() can be called).

Alternatively, the key store could be loaded for every request. (Maybe as an option, so that only multi-process enviroments have to do that.) However, I don't know the real performance implications. Maybe we should have a look how other multi-threaded or multi-process applications use the KeyStore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant