Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bcb4d091
Commit
bcb4d091
authored
Jul 17, 2015
by
Salvatore Sanfilippo
Browse files
Merge pull request #2636 from badboy/cluster-lock-fix
Cluster lock fix
parents
29391002
c7462ca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
bcb4d091
...
...
@@ -358,6 +358,11 @@ void clusterSaveConfigOrDie(int do_fsync) {
* On success REDIS_OK is returned, otherwise an error is logged and
* the function returns REDIS_ERR to signal a lock was not acquired. */
int
clusterLockConfig
(
char
*
filename
)
{
/* flock() does not exist on Solaris
* and a fcntl-based solution won't help, as we constantly re-open that file,
* which will release _all_ locks anyway
*/
#if !defined(__sun)
/* To lock it, we need to open the file in a way it is created if
* it does not exist, otherwise there is a race condition with other
* processes. */
...
...
@@ -385,6 +390,8 @@ int clusterLockConfig(char *filename) {
}
/* Lock acquired: leak the 'fd' by not closing it, so that we'll retain the
* lock to the file as long as the process exists. */
#endif
/* __sun */
return
REDIS_OK
;
}
...
...
src/redis.c
View file @
bcb4d091
...
...
@@ -53,7 +53,6 @@
#include <sys/resource.h>
#include <sys/utsname.h>
#include <locale.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
/* Our shared "common" objects */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment