const page = 14
const article = {
title: "Python 多进程并发「读-改-写」共享文件丢失更新 Lost Update —— 用 flock 文件锁修复",
publishedAt: "2026.09.05",
tags: ["多进程并发","读改写竞态","Lost Update"],
href: "/blogs/2026-09-05-1600-multiprocess-lost-update-flock"
}
export default articleconst article = {
title: "Python 多进程并发「读-改-写」共享文件丢失更新 Lost Update —— 用 flock 文件锁修复",
publishedAt: "2026.09.05",
tags: ["多进程并发","读改写竞态","Lost Update"],
href: "/blogs/2026-09-05-1600-multiprocess-lost-update-flock"
}
export default articleconst article = definePost()
Python 多进程并发「读-改-写」共享文件丢失更新 Lost Update —— 用 flock 文件锁修复
在并行批处理任务中,多个 worker 进程并发往同一个「进度/结果计数器」文件累加数值,但最终统计总数远小于理论值。
const article = {
title: "AI日报 2026-09-05",
publishedAt: "2026.09.05",
tags: ["朕喜技术","科技资讯","人工智能"],
href: "/blogs/ai-daily-2026-09-05"
}
export default articleconst article = {
title: "AI日报 2026-09-05",
publishedAt: "2026.09.05",
tags: ["朕喜技术","科技资讯","人工智能"],
href: "/blogs/ai-daily-2026-09-05"
}
export default articleconst article = definePost()
AI日报 2026-09-05
今日看点:趋境科技与摩尔线程达成战略合作,国产PD异构方案进入生产环境;星尘智能发布SmoothRL框架解决异步推理下的在线强化学习问题;AFAC金融AI大赛落幕,2万名选手同台竞技;ScienceDiscovery以树搜索驱动RSI,小时级生成通用积分器。
const article = {
title: "Bash 管道 while read 里变量丢失:子 shell 作用域陷阱",
publishedAt: "2026.09.04",
tags: [],
href: "/blogs/2026-09-04-0000-shell-pipe-while-read-subshell"
}
export default articleconst article = {
title: "Bash 管道 while read 里变量丢失:子 shell 作用域陷阱",
publishedAt: "2026.09.04",
tags: [],
href: "/blogs/2026-09-04-0000-shell-pipe-while-read-subshell"
}
export default articleconst article = definePost()
Bash 管道 while read 里变量丢失:子 shell 作用域陷阱
写了一个运维脚本 `count_errors.sh` 统计一批日志文件中的 `ERROR` 行数。思路是用 `cat "$logfile" | while read -r line; do ... done` 逐行读每个日志文件,命中 `ERROR` 就把计数器 `total` 加一,最后输出总数。
const article = {
title: "docker stop 卡满 10s 被 SIGKILL:SIGTERM 被 PID1 shell 吞掉不转发",
publishedAt: "2026.09.04",
tags: [],
href: "/blogs/2026-09-04-0809-docker-stop-sigterm-pid1-shell-not-forward"
}
export default articleconst article = {
title: "docker stop 卡满 10s 被 SIGKILL:SIGTERM 被 PID1 shell 吞掉不转发",
publishedAt: "2026.09.04",
tags: [],
href: "/blogs/2026-09-04-0809-docker-stop-sigterm-pid1-shell-not-forward"
}
export default articleconst article = definePost()
docker stop 卡满 10s 被 SIGKILL:SIGTERM 被 PID1 shell 吞掉不转发
把一个带"有状态"的 Python 服务 `app.py`(收到 SIGTERM 会把处理条数写入 `/app/state.txt` 后优雅退出)打包进 Docker 镜像,入口(`CMD`)指向一个 shell 启动脚本:
const article = {
title: "Docker 容器 /dev/shm 默认 64M 写满:No space left on device 解决",
publishedAt: "2026.09.04",
tags: [],
href: "/blogs/2026-09-04-1609-docker-shm-tmpfs-64m-nospace"
}
export default articleconst article = {
title: "Docker 容器 /dev/shm 默认 64M 写满:No space left on device 解决",
publishedAt: "2026.09.04",
tags: [],
href: "/blogs/2026-09-04-1609-docker-shm-tmpfs-64m-nospace"
}
export default articleconst article = definePost()
Docker 容器 /dev/shm 默认 64M 写满:No space left on device 解决
后端/数据工程师在容器里跑批处理任务:`worker.py` 要把 128MB 中间结果分块写入 `/dev/shm/payload.dat`(Linux 的共享内存 tmpfs,读写走内存、极快,多进程共享暂存常用)。 宿主机上跑得好好的,一进 Docker 容器就报: ``` OSError(28, 'No s
const article = {
title: "AI日报 2026-09-04",
publishedAt: "2026.09.04",
tags: ["朕喜技术","科技资讯","人工智能"],
href: "/blogs/ai-daily-2026-09-04"
}
export default articleconst article = {
title: "AI日报 2026-09-04",
publishedAt: "2026.09.04",
tags: ["朕喜技术","科技资讯","人工智能"],
href: "/blogs/ai-daily-2026-09-04"
}
export default articleconst article = definePost()
AI日报 2026-09-04
今日看点:陈大年复出发布27B本地模型,MCP测试综合第二逼近DeepSeek万亿旗舰;Anthropic升级Claude Computer Use支持后台操作;OpenAI ChatGPT桌面版取代Atlas成为主力浏览器;腾讯WorkBuddy开放平台接入100+硬件伙伴;影眸发布WorldGen场景级3D生成模型
const article = {
title: "crontab 定时任务静默失败:脚本手动执行成功但 cron 里不运行(PATH 问题排查实录)",
publishedAt: "2026.09.03",
tags: [],
href: "/blogs/2026-09-03-0812-crontab-silent-failure"
}
export default articleconst article = {
title: "crontab 定时任务静默失败:脚本手动执行成功但 cron 里不运行(PATH 问题排查实录)",
publishedAt: "2026.09.03",
tags: [],
href: "/blogs/2026-09-03-0812-crontab-silent-failure"
}
export default articleconst article = definePost()
crontab 定时任务静默失败:脚本手动执行成功但 cron 里不运行(PATH 问题排查实录)
运维中常见一类诡异故障:**备份/定时脚本手动执行一切正常,但 crontab 里却"不跑"或"静默失败"**——目录里没有新增文件,`/var/log/syslog`、`/var/log/cron`、邮件里也查不到任何报错,仿佛任务被系统"吞掉"。
const article = {
title: "系统盘坏了 MySQL 5.7 数据如何完整恢复:把坏盘当数据盘物理迁移 datadir(宝塔 Debian11 实测)",
publishedAt: "2026.09.03",
tags: ["MySQL 5.7 数据恢复","系统盘损坏","坏盘数据盘迁移"],
href: "/blogs/2026-09-03-1400-mysqldatadir"
}
export default articleconst article = {
title: "系统盘坏了 MySQL 5.7 数据如何完整恢复:把坏盘当数据盘物理迁移 datadir(宝塔 Debian11 实测)",
publishedAt: "2026.09.03",
tags: ["MySQL 5.7 数据恢复","系统盘损坏","坏盘数据盘迁移"],
href: "/blogs/2026-09-03-1400-mysqldatadir"
}
export default articleconst article = definePost()
系统盘坏了 MySQL 5.7 数据如何完整恢复:把坏盘当数据盘物理迁移 datadir(宝塔 Debian11 实测)
一台 Debian 11 + 宝塔面板 v13.0.0 + MySQL 5.7 的服务器**只有一块系统盘**,上面跑着多个站点的业务库(商城/博客/用户中心/ERP)。某天系统盘"系统层面"坏了,机器起不来(开机崩溃/引导丢失)。**但硬盘本身大概率还能读到**,MySQL 的数据文件仍在盘上。
const article = {
title: "Python 多线程被 GIL 限制跑不满多核:用 ProcessPoolExecutor 解决",
publishedAt: "2026.09.03",
tags: [],
href: "/blogs/2026-09-03-1600-gil-multithreading-multiprocess"
}
export default articleconst article = {
title: "Python 多线程被 GIL 限制跑不满多核:用 ProcessPoolExecutor 解决",
publishedAt: "2026.09.03",
tags: [],
href: "/blogs/2026-09-03-1600-gil-multithreading-multiprocess"
}
export default articleconst article = definePost()
Python 多线程被 GIL 限制跑不满多核:用 ProcessPoolExecutor 解决
维护的图片加签/内容指纹服务(Python)里有个 **CPU 密集型**函数 `hash_content`(大量 `sha256` 迭代哈希),被 Web 接口反复调用。为提升并发吞吐,用 `ThreadPoolExecutor(max_workers=8)` 开 8 个线程去跑,期望 8 核各干各的、吞吐翻几倍
const article = {
title: "AI日报 2026-09-03",
publishedAt: "2026.09.03",
tags: ["朕喜技术","科技资讯","人工智能"],
href: "/blogs/ai-daily-2026-09-03"
}
export default articleconst article = {
title: "AI日报 2026-09-03",
publishedAt: "2026.09.03",
tags: ["朕喜技术","科技资讯","人工智能"],
href: "/blogs/ai-daily-2026-09-03"
}
export default articleconst article = definePost()
AI日报 2026-09-03
AI代理擅自删预约事件引发权限边界讨论;OpenAI Astra安全评估展示零日漏洞发现能力;Anthropic推出新模型与企业护栏;全球首台万元级人形机器人发布,谷歌、ChatGPT健康应用加速AI进入工作流。
