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

[ZEPPELIN-5885] Solve the concurrency clone note #4563

Merged
merged 1 commit into from Mar 22, 2023

Conversation

qinbo12
Copy link
Contributor

@qinbo12 qinbo12 commented Feb 11, 2023

What is this PR for?

This pull request migrates solve the concurrency problem caused by multiple concurrent calls to note clone.

What type of PR is it?

[Bug Fix]

What is the Jira issue?

How should this be tested?

  • Try to build module zeppelin-zengine by command
    ./mvnw -B -pl 'zeppelin-server,zeppelin-zengine,zeppelin-common,zeppelin-interpreter,zeppelin-jupyter' clean package -
    DskipTests -Pbuild-distr -Pinclude-hadoop -Phadoop3 -Pweb-angular

@Reamer
Copy link
Contributor

Reamer commented Feb 23, 2023

Please open a JIRA ticket. A stack trace of the error would be good in the ticket. It would also be good if you use the pull request template.

@qinbo12 qinbo12 changed the title Solve the concurrency clone note [ZEPPELIN-5885]Solve the concurrency clone note Mar 1, 2023
@qinbo12 qinbo12 changed the title [ZEPPELIN-5885]Solve the concurrency clone note [ZEPPELIN-5885] Solve the concurrency clone note Mar 1, 2023
@qinbo12
Copy link
Contributor Author

qinbo12 commented Mar 1, 2023

Please open a JIRA ticket. A stack trace of the error would be good in the ticket. It would also be good if you use the pull request template.

Hello, I have JIRA https://issues.apache.org/jira/browse/ZEPPELIN-5885 sheet and provided test case and stack information.

Copy link
Contributor

@Reamer Reamer left a comment

Choose a reason for hiding this comment

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

LGTM

@Reamer Reamer merged commit 5d102f5 into apache:master Mar 22, 2023
@youshaojun
Copy link
Contributor

hi~, I tried to use the above modifications, but now occasionally throw java.nio.file.NoSuchFileException

Caused by: java.nio.file.NoSuchFileException: /usr/local/zeppelin-0.10.1-bin-all/conf/notebook-authorization.json
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)
	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
	at java.nio.file.Files.move(Files.java:1395)
	at org.apache.zeppelin.util.FileUtils.atomicWriteToFile(FileUtils.java:60)
	at org.apache.zeppelin.util.FileUtils.atomicWriteToFile(FileUtils.java:71)
	at org.apache.zeppelin.storage.LocalConfigStorage.save(LocalConfigStorage.java:71)
	at org.apache.zeppelin.notebook.AuthorizationService.saveNoteAuth(AuthorizationService.java:109)
	at org.apache.zeppelin.notebook.Notebook.createNote(Notebook.java:258)
	at org.apache.zeppelin.service.NotebookService.createNote(NotebookService.java:168)

whether this method requires a lock ?

@Reamer
Copy link
Contributor

Reamer commented Jun 7, 2023

Are you sure it is because of this change?
I think you have another concurrency problem.

@youshaojun
Copy link
Contributor

Thanks for your reply.
This pull request migrates solve the concurrency problem caused by multiple concurrent calls to org.apache.zeppelin.notebook.AuthorizationService#saveNoteAuth, but this can result in concurrent modifications to notebook authorization.json.

image

image

@Reamer
Copy link
Contributor

Reamer commented Jun 8, 2023

A synchronized at the saveNoteAuth method should fix the problem. What do you think?

@youshaojun
Copy link
Contributor

Yes, i also think.

@Reamer
Copy link
Contributor

Reamer commented Jun 8, 2023

Feel free to prepare a PullRequest with JIRA ticket. Your StackTrace should be included in the JIRA ticket.

@youshaojun
Copy link
Contributor

Mybe a synchronized at the org.apache.zeppelin.util.FileUtils#atomicWriteToFile(java.lang.String, java.io.File, java.util.Set<java.nio.file.attribute.PosixFilePermission>) is a better option.

@Reamer
Copy link
Contributor

Reamer commented Jun 8, 2023

I don't think so, because this function is used by all save operations. e.g. when note files are created. These would then block each other.

@youshaojun
Copy link
Contributor

Thanks for your reply. I understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants