Skip to content

Fixing compilation by removing flock() when compiling on Solaris - #11327

Merged
oranagra merged 1 commit into
redis:unstablefrom
sapsDev:unstable
Sep 27, 2022
Merged

oranagra merged 1 commit into
redis:unstablefrom
sapsDev:unstable

Conversation

@steffen-moser

@steffen-moser steffen-moser commented Sep 27, 2022 •

Copy link
Copy Markdown
Contributor

SunOS/Solaris and its relatives don't support the flock() function. While "redis" has been excluding setting up the lock using flock() on the cluster configuration file in https://github.com/redis/redis/blob/unstable/src/cluster.c#L502 when compiling under Solaris, it was still using flock() in the unlock call while shutting down.

This pull request eliminates the flock() call also in the unlocking stage for Oracle Solaris and its relatives.

Fix compilation regression from #10912

@oranagra

Copy link
Copy Markdown
Member

@steffen-moser didn't you say that maybe we can achieve our purpose with an fcntl?
(I haven't looked at the compatibility of either myself)

@steffen-moser

steffen-moser commented Sep 27, 2022 •

Copy link
Copy Markdown
Contributor Author

Yes, the statement which turned me away from doing this, has been already given in https://github.com/redis/redis/blob/unstable/src/cluster.c#L498-L500 where the lock is set up (except for Solaris!):

So what my PR is doing, is basically just a symmetrical behavior. As we don't set up the lock in Solaris, we don't have to unlock anything.

@oranagra
oranagra merged commit 6aab4cb into redis:unstable Sep 27, 2022
@oranagra oranagra added the release-notes indication that this issue needs to be mentioned in the release notes label Sep 27, 2022
@oranagra oranagra mentioned this pull request Dec 11, 2022
oranagra pushed a commit that referenced this pull request Dec 12, 2022
)

SunOS/Solaris and its relatives don't support the flock() function.
While "redis" has been excluding setting up the lock using flock() on the cluster
configuration file when compiling under Solaris, it was still using flock() in the
unlock call while shutting down.

This pull request eliminates the flock() call also in the unlocking stage
for Oracle Solaris and its relatives.

Fix compilation regression from #10912

(cherry picked from commit 6aab4cb)
madolson pushed a commit to madolson/redis that referenced this pull request Apr 19, 2023
…is#11327)

SunOS/Solaris and its relatives don't support the flock() function.
While "redis" has been excluding setting up the lock using flock() on the cluster
configuration file when compiling under Solaris, it was still using flock() in the
unlock call while shutting down. 

This pull request eliminates the flock() call also in the unlocking stage
for Oracle Solaris and its relatives.

Fix compilation regression from redis#10912
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
…is#11327)

SunOS/Solaris and its relatives don't support the flock() function.
While "redis" has been excluding setting up the lock using flock() on the cluster
configuration file when compiling under Solaris, it was still using flock() in the
unlock call while shutting down. 

This pull request eliminates the flock() call also in the unlocking stage
for Oracle Solaris and its relatives.

Fix compilation regression from redis#10912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-notes indication that this issue needs to be mentioned in the release notes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants