You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "fapifta (via GitHub)" <gi...@apache.org> on 2023/03/11 22:10:30 UTC
[GitHub] [ozone] fapifta opened a new pull request, #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
fapifta opened a new pull request, #4381:
URL: https://github.com/apache/ozone/pull/4381
## What changes were proposed in this pull request?
The intent of the renewLock in the DefaultCertificateClient is to ensure no more than one thread changes the on disk certificate material at a given time. The problem is that the lock is belonging to an instance of the CertificateClient implementation, and with that there might be multiple instances from the lock.
As we do not use any of the properties of a ReentrantLock, I simply think we should synchronize the renewal and the on disk operations on the class.
In the meantime, I switched to shutdownNow instead of shutDown in the executor, after HDDS-8134 we do not have multiple executors running at the same time, but the service after close should not schedule any new runs but should finish the current run. This is not a foolproof implementation, but a good enough one for now. We are working on this code and there are further changes to how it is structured, so I think we should wait for the final form to get to a good solution, where only one executor is present per certificate material.
An other warning is also fixed by this patch, as notificationReceivers are also guarded by a synchronized block locking on the Set itself, but the instance is not final. This is not really a problem, as we do not tackle with the instance anymore, but seemed to be something that we can fix together.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8135
## How was this patch tested?
Existing tests should suffice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] fapifta commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1494905825
Yes @ChenSammi you were right, after solving the closure of clients properly, the problem with this patch gone away. And as if it is ensured that only one such client exists, then the problem should not come back.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "kerneltime (via GitHub)" <gi...@apache.org>.
kerneltime commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1466487443
cc @DaveTeng0 can you take a look please.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "kerneltime (via GitHub)" <gi...@apache.org>.
kerneltime commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1466486321
cc @SaketaChalamchala can you take a look as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] kerneltime commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "kerneltime (via GitHub)" <gi...@apache.org>.
kerneltime commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1466483668
@Galsza can you please take a look.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] ChenSammi commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1467278065
Looks like this situation is caused by not closed certificate clients. When all unnecessary clients are closed in HDDS-8134, I think then there will be no such problem. @fapifta
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] fapifta commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "fapifta (via GitHub)" <gi...@apache.org>.
fapifta commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1466893286
Converted back the PR to draft, as I realized that the problem with the tests are not just simple glitches.
In the failing tests, there are still multiple executors at the same time, and locking on the static context of the class combined with an "infinite" (Integer.MAX_VALUE) number of retries in one thread in the test causes the test to timeout whatever it takes.
I will explore some other solutions, and we will discuss with @ChenSammi the original author on how we want to solve this, but the solution itself as it seems will require a deeper thought and a broader change.
I don't like the simple idea of making the executor static as well, and then guard that way for the first sight, but I am open to discuss that as an option as well.
We don't need to rush at the moment, as in a production system, there should not be competing threads as far as I can tell.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] ChenSammi commented on pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi commented on PR #4381:
URL: https://github.com/apache/ozone/pull/4381#issuecomment-1495460788
The patch LGTM +1. Thanks @fapifta
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
[GitHub] [ozone] ChenSammi merged pull request #4381: HDDS-8135. Incorrect synchronization during certificate renewal in DefaultCertificateClient.
Posted by "ChenSammi (via GitHub)" <gi...@apache.org>.
ChenSammi merged PR #4381:
URL: https://github.com/apache/ozone/pull/4381
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org