共 10 句 · 中英对照 · 对应本级 10 个目标词
开始练这一级 →Last month our service went down for an hour after a new release.上个月,我们的服务在一次新发布后中断了一个小时。 We opened a code review and looked at the logs, but they gave no clear answer.我们开了一次代码评审并查看了日志,但日志没有给出清楚的答案。 A bottleneck in one job queue was the real problem: many workers used the same mutex, so they waited in line and then failed with timeouts.真正的问题是一个任务队列里的「bottleneck」(瓶颈):许多工作进程使用同一个「mutex」(互斥锁),于是排队等待,随后因超时而失败。
We fixed it with dependency injection and made the worker stateless.我们用「dependency injection」(依赖注入)修好了它,并让工作进程变成「stateless」(无状态)。 The middleware now does not need to serialize every request, and new instances handle more concurrency with the same servers.「middleware」(中间件)现在不需要「serialize」(串行化)每个请求,新的实例用同样的服务器就能处理更多「concurrency」(并发)。
We also tested the new code with an old client: it was backward compatible, so no breaking change reached our users.我们还用一个旧客户端测试了新代码:它是「backward compatible」(向后兼容)的,所以没有「breaking change」(破坏性变更)到达用户那里。 We shipped it with rolling updates and a graceful shutdown, so active jobs finished cleanly.我们用滚动更新和「graceful shutdown」(优雅停机)把它发上去,活跃任务因此干净地完成。 That is why we rolled forward instead of rolling back.这就是我们选择前滚而不是回滚的原因。
The bottleneck is gone, and we saw no timeouts in the next week.瓶颈消失了,接下来一周我们没有再看到超时。 Lesson: plan a new version when a breaking change is truly needed.教训:当「breaking change」(破坏性变更)确实必要时,要规划一个新版本。
数据来源:NGSL(CC BY-SA 4.0)· ECDICT(MIT License)。短文为本项目为练习编写的配套材料。