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 save command history npe, improve load/save history logic #1705

Merged
merged 3 commits into from Feb 23, 2021

Conversation

kylixs
Copy link
Contributor

@kylixs kylixs commented Feb 23, 2021

No description provided.

@hengyunabc
Copy link
Collaborator

这个 commit没从根本解决问题,本质原因是HistoryManagerImpl 不是线程安全的。

@@ -481,6 +482,9 @@ public void destroy() {
sessionManager.close();
sessionManager = null;
}
if (historyManager != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里有问题,会把原来 termd里保存的 history清空了。
如果用户没用过http api,则这里保存的历史还是arthas启动时原来的那一份。

本质上是history有两份存储了。目前应该忽略http api里的那一份。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

目前每个shell 的cmd history都是单独维护的,不同telnet session相互也会覆盖history。
http api则是用同一份history,与shell的history相互覆盖,已修改为不持久化http api的history。

@hengyunabc hengyunabc merged commit 1376c88 into alibaba:master Feb 23, 2021
@hengyunabc hengyunabc modified the milestones: 4.0.x, 3.4.7 Feb 23, 2021
@kylixs kylixs deleted the fix-save-history-npe branch September 23, 2021 07:26
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.

None yet

2 participants