Comments (9)
@pipiiiiii @erha19 好像这里还有另一个问题,在断网或者休眠时,有一定概率丢失请求数据。
这块 websocket 超时需要 120s,但是期间 this._ws.readyState 还是ok的,在此期间前端的发的请求不会放到 _messageQueue,如果 websocket 超时, 会丢失这部分数据。
from core.
补充一个数据丢失引发的副作用,期间前端的状态已经变化,但是后端没有收到,前后端状态不一致。
此时例如文件展开,文件打开,都无法正常进行了。
上诉前后端不可交互由此引发。和 connect lock 应该无关
from core.
@piLurk 由于重连导致的一些问题之前修过一些
- #2530
- #2910
一个是插件进程重启失败导致进程卡主,一个是重启后 fileWatcher 失效的问题
同时还给 rpc 通信增加了超时时间的配置,默认是关闭的,可以开启辅助排查问题 - #2587
- #2709
from core.
如果想要调试重连的问题,可以在 https://github.com/opensumi/core/blob/main/packages/core-browser/src/bootstrap/connection.ts#L61 这里主动调用重连
setTimeout(() => {
// @ts-ignore
wsChannelHandler.connection.reconnect();
}, 30 * 1000);
from core.
@pipiiiiii 业务层有做数据恢复么,我理解可能还不能解决这个问题。。
这里的本质问题是reconnecting-websocket
这个包对于 websoket 是否可用完全是依赖 readyState
来做检查,但是除此之外,网络波动/休眠/切换网络/服务拥塞 等 都会引发 websoket 不可用。
此时在不可用的 websoket 连接中已经发送了一些数据,这些数据就会丢失
from core.
@pipiiiiii 业务层有做数据恢复么,我理解可能还不能解决这个问题。。 这里的本质问题是
reconnecting-websocket
这个包对于 websoket 是否可用完全是依赖readyState
来做检查,但是除此之外,网络波动/休眠/切换网络/服务拥塞 等 都会引发 websoket 不可用。 此时在不可用的 websoket 连接中已经发送了一些数据,这些数据就会丢失
目前并没有做数据恢复,增加超时时间可以防止发出去没有消息返回导致代码一直等待执行的问题。
如果需要数据恢复,我理解在发送消息时根据业务逻辑处理比较好,因为现在 node 端在连接断开时会 disposeAll,仅仅重发消息不一定能解决问题
from core.
对于没有返回值的 WS 消息,是不是可以有个 buffer 缓存,再重连阶段重新发一下(目前好像是超时直接返回,有点矛盾)
from core.
https://github.com/opensumi/core/blob/main/packages/core-node/src/connection.ts#L50
这里做了 disposeAll 处理,如果是因为断连导致的无返回值,仅仅重发不一定会符合预期,因为这个时候如果获取到消息返回值,后续执行逻辑的一些实例可能已经被销毁了
from core.
不过或许可以在断连时将已经发出的去消息全部 reject ,不用等超时
from core.
Related Issues (20)
- [BUG] 新版 monaco 下格式化的配置无法持久化 HOT 2
- [Question] 请问 ide-debug 对应 core 代码库的哪个文件 HOT 7
- [Question] 环境安装问题 HOT 1
- [FEATURE] 搜索面板没有一个一键清除所有搜索结果的按钮 & 按文件树排列
- [Question] 如何弹出系统风格的窗口? HOT 1
- [BUG] 使用report渲染message消息时无法继承registerAIRoleRender的渲染
- [BUG] ai chat面板重新渲染会话
- I have cloned ide-electron but require English version of it HOT 1
- [Question] 纯Web版离线使用 HOT 1
- [BUG] The diff editor state should be restored when open again
- [BUG] DesignModule 样式适配 HOT 3
- [FEATURE] [AI Native] inline chat 的 diff 预览视图新增流式渲染
- [FEATURE] Ai Native Chat input支持定制
- [FEATURE] 兼容 Electron 30
- [Question] 通过IDIalogService.open打开的对话框,如何设置按下回车键时不关闭? HOT 2
- [BUG] Textarea组件无法正常focus
- [Question] 请问终端是在哪里创建的? HOT 5
- [Question] 开发模式下右键菜单可以正常显示粘贴选项,打包放到服务器上粘贴选项反而消失了? HOT 5
- [BUG] node 进程长时间停留,当天日期日志仅剩下 extHost.log
- [BUG] cli-engine 下载不了,提示 invalid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.