Skip to content

Conversation

@jhuan31
Copy link

@jhuan31 jhuan31 commented Oct 13, 2019

No description provided.

@jhuan31
Copy link
Author

jhuan31 commented Oct 14, 2019

retest maven build

1 similar comment
@jhuan31
Copy link
Author

jhuan31 commented Oct 14, 2019

retest maven build

@maoling
Copy link
Member

maoling commented Oct 15, 2019

@eolivelli
Jenkins had broken down?

@eolivelli
Copy link
Contributor

Yes.
We should fix the config.
I will do it as soon as possible, we have to switch to maven 3.6.2

@lvfangmin
Copy link
Contributor

retest maven build

@lvfangmin
Copy link
Contributor

@eolivelli we didn't see the 'restart' button on the Jenkins page, any permission we need to set up?

@hanm
Copy link
Contributor

hanm commented Nov 18, 2019

we didn't see the 'restart' button on the Jenkins page, any permission we need to set up?

@lvfangmin You might need administrative permission to manage Jenkins (create new project, configure, and restart jobs...). See https://cwiki.apache.org/confluence/display/INFRA/Jenkins for more details.

@eolivelli
Copy link
Contributor

@lvfangmin @fpj can grant you acess (only the PMCC as far as I know)


@Test
public void testLearnerMetricsTest() throws Exception {
Learner.setAsyncSending(asyncSending);
Copy link
Contributor

Choose a reason for hiding this comment

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

please reset the value in a @before method
it is a static flag, so it will affect other tests

Copy link
Author

Choose a reason for hiding this comment

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

I assume you mean "reset in @after?"

@Before
public void setup() {
System.setProperty("zookeeper.DigestAuthenticationProvider.superDigest", "super:D/InIHSb7yEEbrWz8b9l71RjZJU="/* password is 'test'*/);
Learner.setAsyncSending(asyncSending);
Copy link
Contributor

Choose a reason for hiding this comment

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

please reset the value in a @before method
it is a static flag, so it will affect other tests

Copy link
Author

Choose a reason for hiding this comment

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

reset in @afterclass

break;
}

learner.messageTracker.trackSent(p.getType());
Copy link
Contributor

Choose a reason for hiding this comment

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

here https://github.com/apache/zookeeper/pull/1116/files#diff-c8b414c1ca2084ecb9fe32a0a3832d44R170
we accessing learner internal variables inside a synchronized block.
it looks like an inconsistent synchronization

maybe it depends on the fact that this feature is enabled or not, but I am not sure we are 100% safe
can you please motivate or at least leave some comment for future inspection and understanding of the flow ?

Copy link
Author

Choose a reason for hiding this comment

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

Without LearnerSender, there might be more than one thread writing to leaderOs so synchronization is required.

With LearnerSender, there still might be more than one thread calling writePacket but they are writing to a BlockingQueue so it's fine. Reading from the queue and writing to leaderOs is one thread (the learner sender thread), so we don't need synchronization. It's like we synchronize on the blockingQueue implicitly.

This is tricky. I may have missed some thing. Let me know and I'll fix the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a minimal comment to explain this point?
I agree with your explanation

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good to me, it might be better to not visit the internal variable directly, but using things like get to make the code easier to manage and reason about though.

@asf-ci
Copy link

asf-ci commented Dec 12, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build-maven/1715/

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

I left one last request to add a comment

@lvfangmin @hanm PTAL
We need one more reviewer

self.closeAllConnections();
self.adminServer.setZooKeeperServer(null);

if (sender != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: diff shows a missing space

Copy link
Author

Choose a reason for hiding this comment

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

good catch

break;
}

learner.messageTracker.trackSent(p.getType());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a minimal comment to explain this point?
I agree with your explanation

Copy link
Contributor

@lvfangmin lvfangmin left a comment

Choose a reason for hiding this comment

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

+1

LGTM, thanks Jie for upstreaming this.

break;
}

learner.messageTracker.trackSent(p.getType());
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good to me, it might be better to not visit the internal variable directly, but using things like get to make the code easier to manage and reason about though.

@eolivelli
Copy link
Contributor

Let's merge

@jhuan31
Copy link
Author

jhuan31 commented Jan 6, 2020

@eolivelli Added a comment to explain the synchronization on leaderOs.

Copy link
Contributor

@lvfangmin lvfangmin left a comment

Choose a reason for hiding this comment

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

+1

LGTM, thanks @jhuan31, I'll merge this tomorrow if there is no objection.

@asfgit asfgit closed this in 7c1251d Jan 25, 2020
@lvfangmin
Copy link
Contributor

Merged to master, thanks @jhuan31!

junyoungKimGit pushed a commit to junyoungKimGit/zookeeper that referenced this pull request Feb 7, 2020
stickyhipp pushed a commit to stickyhipp/zookeeper that referenced this pull request Aug 19, 2020
functioner pushed a commit to functioner/zookeeper that referenced this pull request Mar 24, 2021
Author: Jie Huang <[email protected]>

Reviewers: [email protected], [email protected]

Closes apache#1116 from jhuan31/ZOOKEEPER-3575

(cherry picked from commit 7c1251d)
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Sep 3, 2022
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.

6 participants