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

Read and Write lock for global config #39

Merged
merged 3 commits into from Oct 6, 2021

Conversation

vthiruveedula
Copy link
Contributor

No description provided.

@vthiruveedula
Copy link
Contributor Author

test container

1 similar comment
@yoooou
Copy link

yoooou commented Oct 4, 2021

test container

@thakurajayL
Copy link
Contributor

retest container

@@ -375,6 +380,8 @@ func getDeleteGroupsList(slice, prevSlice *configmodels.Slice) (names []string)
}
func Config5GUpdateHandle(confChan chan *Update5GSubscriberMsg) {
for confData := range confChan {
rwLock.RLock()
rwLock.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we lock and Unlock immediately in next line ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo mistake. As per your comments, used Locks and Unlocks wherever it is required

@@ -78,13 +80,17 @@ func configHandler(configMsgChan chan *configmodels.ConfigMessage, configReceive
configLog.Infoln("Waiting for configuration event ")
select {
case configMsg := <-configMsgChan:
rwLock.Lock()
defer rwLock.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer will never get called. and every select loop we will try to Lock() ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please call explitc rwLock.Unlock() instead of using defer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

var configUMsg Update5GSubscriberMsg
configUMsg.Msg = configMsg
subsUpdateChan <- &configUMsg
if factory.WebUIConfig.Configuration.Mode5G == true {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh..I spend so much time identifying this problem. Look at my changes in #41. ... Webconsole was getting blocked. I am suspecting this is what happened in production network as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly this would have happened in production network. sorry for inconvenience

postConfigHss(client, nil)
rwLock.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why lock only for hss ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imsiData used inside postConfigHss Hence i used Rlock here

@thakurajayL thakurajayL merged commit d5c93c1 into onf-release3.0.5 Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants