-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(portal): 只在使用文件传输功能时利用touch -a更新时间戳 (#1133)
### 问题 因为文件传输功能需要使用 `touch -a` 更新时间戳来触发 nfs 缓存机制 目前在没有使用文件传输功能时也会在访问文件路径时对其下所有文件使用 `touch -a` ,给后台维护带来不便 此PR修复为只在文件传输功能中对文件执行`touch -a`,同时修复文件名中出现中文字符或特殊字符如";"时 `touch -a` 无法正常执行会在后台打印logger.error的问题 ### 修复前 在只进行文件管理下的路径访问时,后台也会出现部分 `touch -a` 的报错 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/5bd3e70f-da35-4728-9cb5-5bacbc77b9d6) ![image](https://github.com/PKUHPC/SCOW/assets/43978285/78ea6889-63d0-4e31-817c-c38bdd26dba6) ### 修复后 **1.只在文件传输时执行`touch -a`更新访问时间戳** 访问/data/home/demo_admin/前 /data/home/demo_admin/MNIST.ipynb的时间戳 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/4b64dd39-f8ed-4368-8245-398bc017c83c) 文件管理及提交作业页面选择文件路径时不执行touch -a,不出现touch -a相关报错 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/6f3b4172-664e-4aee-b527-532054516631) /data/home/demo_admin/MNIST.ipynb的时间戳无变化 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/82b39cbf-d437-486a-bd68-28fa4c0a87bc) 在文件传输功能时因为/data/home/demo_admin/下某文件路径权限问题touch -a报错 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/3f823a01-e74a-4ad0-b6bf-316f2bbae4d6) /data/home/demo_admin/MNIST.ipynb的时间戳更新 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/5ce31248-08c4-4dba-b3fc-4b20494d3b86) 开发环境文件传输相关功能无异常 **2.特殊字符的情况可以正常执行 `touch -a` 不会在后台留下错误** ![image](https://github.com/PKUHPC/SCOW/assets/43978285/14edd2af-0c7d-4482-bad6-0a691ff5b450) 时间戳正常更新 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/dba27f86-4206-4dfe-ab5c-f6775dcfca2d) ### 同时此PR修复了下面有关`touch -a`执行的问题 **对 #1103 中下述问题进行修复:** 1. 异步会导致ssh提前关闭,无法正常执行`touch -a`, 会一直报错 `unable to exec` ![image](https://github.com/PKUHPC/SCOW/assets/43978285/5f680c39-f144-4115-b5a5-83b896080a03) 2. 文件切分时切分的是字符串而不是文件数组,导致执行路径出现错误 **针对文件名长度可能引发的错误问题下调每次执行文件数量安全值:** 按一般系统最大命令字节数2097152字节,文件名最长4096字节,下调每一次touch -a执行的文件数量为安全值500
- Loading branch information
Showing
6 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@scow/grpc-api": patch | ||
--- | ||
|
||
在文件管理的 readDirectory 接口下增加可选参数 updateAccessTime,只在文件传输功能时更新时间戳 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@scow/portal-server": patch | ||
"@scow/portal-web": patch | ||
--- | ||
|
||
修复只需在文件传输时使用 touch -a 来更新时间戳,修复 touch -a 执行时 ssh 关闭报错,文件名特殊字符报错等问题 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters