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

fix the set of events received by ChildrenW #66

Merged
merged 2 commits into from
Dec 9, 2021
Merged

fix the set of events received by ChildrenW #66

merged 2 commits into from
Dec 9, 2021

Conversation

sakateka
Copy link

In accordance with
https://github.com/apache/zookeeper/blob/c74658d398cdc1d207aa296cb6e20de00faec03e/zookeeper-client/zookeeper-client-c/src/zk_hashtable.c#L297-L314

    switch(type){
    case CREATED_EVENT_DEF:
    case CHANGED_EVENT_DEF:
        // look up the watchers for the path and move them to a delivery list
        add_for_event(zh->active_node_watchers,path,&list);
        add_for_event(zh->active_exist_watchers,path,&list);
        break;
    case CHILD_EVENT_DEF:
        // look up the watchers for the path and move them to a delivery list
        add_for_event(zh->active_child_watchers,path,&list);
        break;
    case DELETED_EVENT_DEF:
        // look up the watchers for the path and move them to a delivery list
        add_for_event(zh->active_node_watchers,path,&list);
        add_for_event(zh->active_exist_watchers,path,&list);
        add_for_event(zh->active_child_watchers,path,&list);
        break;
    }

ChildrenW should not receive data change events of the observed node.

I believe that this will fix #38 and it will change the set of events received by ChildrenW described here #56

@nemith
Copy link

nemith commented Sep 13, 2021

Seems good to me. This will be a breaking change so we may have to look at how we want to handle the rollout (probably a new minor release 1.1.0 would make sense? (@pmazzini, @yarikk thoughts?)

Can you add a unit test for this condition?

@codecov
Copy link

codecov bot commented Sep 13, 2021

Codecov Report

Merging #66 (d00c1a3) into master (8866d76) will increase coverage by 1.13%.
The diff coverage is 66.66%.

❗ Current head d00c1a3 differs from pull request most recent head 6744e77. Consider uploading reports for the commit 6744e77 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage   75.27%   76.40%   +1.13%     
==========================================
  Files           7        7              
  Lines        1189     1191       +2     
==========================================
+ Hits          895      910      +15     
+ Misses        202      193       -9     
+ Partials       92       88       -4     
Impacted Files Coverage Δ
conn.go 73.70% <66.66%> (+2.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8866d76...6744e77. Read the comment docs.

@pmazzini pmazzini requested review from pmazzini and removed request for pmazzini September 13, 2021 15:33
@pmazzini
Copy link

probably a new minor release 1.1.0 would make sense?

sounds good to me

@sakateka
Copy link
Author

sakateka commented Sep 14, 2021

Can you add a unit test for this condition?

Yes, I'll try.

@sakateka
Copy link
Author

@nemith PTAL

@sakateka
Copy link
Author

I wrote a test, confirm the launch of checks, and let's merge

@sakateka
Copy link
Author

sakateka commented Oct 7, 2021

@nemith @pmazzini PTAL

1 similar comment
@sakateka
Copy link
Author

@nemith @pmazzini PTAL

@sakateka
Copy link
Author

@nemith @pmazzini hi, can you merge this pr?)

Copy link

@yarikk yarikk left a comment

Choose a reason for hiding this comment

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

lgtm

@yarikk yarikk merged commit 566b763 into go-zookeeper:master Dec 9, 2021
@sakateka sakateka deleted the fix-childrenw-events branch December 10, 2021 03:19
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

Successfully merging this pull request may close these issues.

getw and ChildrenW same path at the same time
4 participants