-
Notifications
You must be signed in to change notification settings - Fork 972
[KYUUBI #5797] Support to describe engine and restart engine with command in current session #5871
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5871 +/- ##
============================================
+ Coverage 61.57% 61.58% +0.01%
Complexity 23 23
============================================
Files 616 618 +2
Lines 36386 36441 +55
Branches 4978 4978
============================================
+ Hits 22404 22442 +38
- Misses 11570 11576 +6
- Partials 2412 2423 +11 ☔ View full report in Codecov by Sentry. |
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/sql/plan/command/DescribeEngine.scala
Outdated
Show resolved
Hide resolved
| engineLaunched = false | ||
| launchEngineOp = sessionManager.operationManager | ||
| .newLaunchEngineOperation(this, shouldRunAsync = false) | ||
| runOperation(launchEngineOp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will re-execute openEngineSession and we need to consider whether some states are as expected.
openedTimewill be reset:sessionEvent.openedTime = System.currentTimeMillis()- do we need to update
engineLastAlive? EngineRef#builderis changed, volatile required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed engineLastAlive , EngineRef#builder.
I think openedTime means engine openedTime, so we don't need to update openedTime.And i changed the org.apache.kyuubi.events.KyuubiSessionEvent#openedTime comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shall need to wrap this method with _client.withLockAcquired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case that other operations access the _client during restarting engine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not be able to use the lock of _client because _client will be assigned a new object after this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case that other operations access the
_clientduring restarting engine.
This seems difficult to avoid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we need to add ReadWriteLock for the client method of KyuubiSessionImpl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we need to add
ReadWriteLockfor theclientmethod ofKyuubiSessionImpl.
submit Operation from multiple threads will meet problem , I will fix it.
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/EngineRef.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/parser/DescribeEngineSuite.scala
Outdated
Show resolved
Hide resolved
|
please rebase your code. |
…current session
OK |
kyuubi-server/src/main/scala/org/apache/kyuubi/events/KyuubiSessionEvent.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/sql/plan/command/RunnableCommand.scala
Outdated
Show resolved
Hide resolved
|
I have some concerns and suggestions,
|
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/parser/RestartEngineSuite.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/parser/RestartEngineSuite.scala
Show resolved
Hide resolved
There are some related discussions in #5797 (comment)
I think we should aim to make this a synchronous operation
I think it's similar to the error that occurs when opening a session
The engine will go offline gracefully without affecting other sessions. |
fixed
|
kyuubi-server/src/test/scala/org/apache/kyuubi/operation/parser/RestartEngineSuite.scala
Outdated
Show resolved
Hide resolved
|
Some errors occurred in the |
For When multi-threads use a session to submit operations, The temporary purpose and requirements are #5797 (comment). I will design and implement in later. Are there any other supplementary scenarios and requirements? |
🔍 Description
Issue References 🔗
This pull request fixes #5797
Describe Your Solution 🔧
Support to describe and register/de-register engine with command in current session
Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
user can use sql
KYUUBI DEREGISTER ENGINEto stop spark engine,KYUUBI REGISTER ENGINEto restart spark engine, andKYUUBI DESCRIBE[DESC] ENGINEto show spark engine info.Related Unit Tests
Checklists
📝 Author Self Checklist
📝 Committer Pre-Merge Checklist
Be nice. Be informative.