# race-condition

A race condition is a concurrency weakness in which concurrent code sequences access shared resources without proper synchronization, allowing timing-dependent or unexpected behavior.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## OAuth token refresh has a race condition. Fix it with a conditional write, not a distributed lock.

DevFeed: [OAuth token refresh has a race condition. Fix it with a conditional write, not a distributed lock.](<https://devfeed.tech/articles/oauth-token-refresh-has-a-race-condition-fix-it-with-a-conditional-write-not-a-distributed-lock-16039.md>)

Original publisher: [Read original article](<https://workos.com/blog/oauth-refresh-token-race-condition>)

Author: WorkOS

Published: 2026-08-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [WorkOS Blog](<https://devfeed.tech/sources/workos-blog.md>)

Topics: [OAuth](<https://devfeed.tech/topics/oauth.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Authorization](<https://devfeed.tech/topics/authorization.md>), [Auth0](<https://devfeed.tech/topics/auth0.md>), [Redis](<https://devfeed.tech/topics/redis.md>)

Tags: [auth0](<https://devfeed.tech/tags/auth0.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [oauth](<https://devfeed.tech/tags/oauth.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [redis](<https://devfeed.tech/tags/redis.md>), [the-result](<https://devfeed.tech/tags/the-result.md>)

### AI overview

This article explains how concurrent OAuth token refreshes can cause two distinct failures: stale tokens from lost updates and user disconnection when refresh-token rotation treats concurrent reuse as replay. It recommends layered defenses, including conditional writes, and explains why a Redis lock does not address both problems.

### Source excerpt

Concurrent refreshes don't just fail. They can disconnect the user entirely. Here are four layers of defense, cheapest first, and why the Redis lock everyone reaches for isn't the one keeping you safe.

## Cypress Ambassador Spotlight: Boris Selivanov

DevFeed: [Cypress Ambassador Spotlight: Boris Selivanov](<https://devfeed.tech/articles/cypress-ambassador-spotlight-boris-selivanov-12603.md>)

Original publisher: [Read original article](<https://www.cypress.io/blog/cypress-ambassador-spotlight-boris-selivanov/>)

Published: 2026-07-24T13:43:32Z

Content type: opinion

Language: en

Sources: [Cypress Blog](<https://devfeed.tech/sources/cypress-blog.md>)

Topics: [Cypress](<https://devfeed.tech/topics/cypress.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [selectors](<https://devfeed.tech/topics/selectors.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Network](<https://devfeed.tech/topics/network.md>), [npm](<https://devfeed.tech/topics/npm.md>)

Tags: [ambassador](<https://devfeed.tech/tags/ambassador.md>), [automation](<https://devfeed.tech/tags/automation.md>), [cypress](<https://devfeed.tech/tags/cypress.md>), [flaky](<https://devfeed.tech/tags/flaky.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [npm](<https://devfeed.tech/tags/npm.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [selectors](<https://devfeed.tech/tags/selectors.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This Cypress Ambassador Spotlight presents Boris Selivanov's advice on sharing reusable testing patterns, choosing stable selectors, and building scalable test automation. It highlights cy.intercept() for controlling network traffic and reducing flaky tests, recommends retry-ability and aliases instead of arbitrary cy.wait(ms), and suggests starting with a real application test after installing Cypress.

### Source excerpt

What motivates you to be a Cypress Ambassador? I see being an Ambassador as the ultimate form of asynchronous collaboration. My goal is to share things that move the needle for other engineers. By comparing how different teams solve the same testing problems, we can turn isolated project victories into shared wins. How do you currently help others that are either using Cypress or interested in using Cypress? I'm the person teammates ping when a test goes flaky or they're not sure how to appro

## OpenAI identified a race condition in a 100-picosecond window

DevFeed: [OpenAI identified a race condition in a 100-picosecond window](<https://devfeed.tech/articles/openai-s-bug-that-hid-inside-a-100-picosecond-window-17941.md>)

Original publisher: [Read original article](<https://read.bytesizeddesign.com/p/openais-bug-that-hid-inside-a-100>)

Author: Byte-Sized Design

Published: 2026-07-06T19:05:51Z

Content type: article

Language: en

Sources: [Byte-Sized Design](<https://devfeed.tech/sources/byte-sized-design.md>)

Topics: [race-condition](<https://devfeed.tech/topics/race-condition.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [bug](<https://devfeed.tech/topics/bug.md>), [OpenAI](<https://devfeed.tech/topics/openai.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [openai](<https://devfeed.tech/tags/openai.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>)

### AI overview

The article describes how OpenAI identified a race condition occurring within a 100-picosecond window.

### Source excerpt

How OpenAI stopped debugging like a doctor and started thinking like an epidemiologist and caught a race condition in the process.

## Cloudflare Found a Race Condition in a Widely Deployed Rust Library

DevFeed: [Cloudflare Found a Race Condition in a Widely Deployed Rust Library](<https://devfeed.tech/articles/the-bug-that-hid-from-every-tool-cloudflare-had-17928.md>)

Original publisher: [Read original article](<https://read.bytesizeddesign.com/p/cloudflare-bug-that-hid-from-every-tool>)

Author: Byte-Sized Design

Published: 2026-06-30T17:31:07Z

Content type: article

Language: en

Sources: [Byte-Sized Design](<https://devfeed.tech/sources/byte-sized-design.md>)

Topics: [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [Cloudflare](<https://devfeed.tech/topics/cloudflare.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [cloudflare](<https://devfeed.tech/tags/cloudflare.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [rust](<https://devfeed.tech/tags/rust.md>)

### AI overview

Cloudflare found a race condition in one of Rust's most-deployed libraries. The reported fix was four lines.

### Source excerpt

Cloudflare found a race condition buried in one of Rust's most-deployed libraries, and the fix was four lines

## Core dump epidemiology: fixing an 18-year-old bug

DevFeed: [Core dump epidemiology: fixing an 18-year-old bug](<https://devfeed.tech/articles/core-dump-epidemiology-fixing-an-18-year-old-bug-6359.md>)

Original publisher: [Read original article](<https://openai.com/index/core-dump-epidemiology-data-infrastructure-bug>)

Published: 2026-06-30T00:00:00Z

Content type: article

Language: en

Sources: [OpenAI News](<https://devfeed.tech/sources/openai-news.md>)

Topics: [bug](<https://devfeed.tech/topics/bug.md>), [OpenAI](<https://devfeed.tech/topics/openai.md>), [Rockset](<https://devfeed.tech/topics/rockset.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Data Infrastructure](<https://devfeed.tech/topics/data-infrastructure.md>), [Azure](<https://devfeed.tech/topics/azure.md>), [Hardware](<https://devfeed.tech/topics/hardware.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>)

Tags: [azure](<https://devfeed.tech/tags/azure.md>), [bug](<https://devfeed.tech/tags/bug.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [data-infrastructure](<https://devfeed.tech/tags/data-infrastructure.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [openai](<https://devfeed.tech/tags/openai.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

OpenAI engineers analyzed a large population of core dumps to investigate rare crashes in the Rockset service. The investigation uncovered two unrelated causes: silent CPU corruption on an Azure host and an 18-year-old race condition in GNU libunwind.

### Source excerpt

OpenAI engineers used large-scale core dump analysis to debug rare infrastructure crashes, uncovering both a hardware fault and a long-standing software bug.

## CVE-2026-46727: Use-after-free in pthread-based getaddrinfo timeout handler

DevFeed: [CVE-2026-46727: Use-after-free in pthread-based getaddrinfo timeout handler](<https://devfeed.tech/articles/cve-2026-46727-use-after-free-in-pthread-based-getaddrinfo-timeout-handler-19152.md>)

Original publisher: [Read original article](<https://www.ruby-lang.org/en/news/2026/05/20/getaddrinfo-cve-2026-46727/>)

Published: 2026-05-20T00:00:00Z

Content type: news

Language: en

Sources: [Ruby-lang](<https://devfeed.tech/sources/ruby-lang.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [vulnerability](<https://devfeed.tech/topics/vulnerability.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Security](<https://devfeed.tech/topics/security.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [cve](<https://devfeed.tech/tags/cve.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [security](<https://devfeed.tech/tags/security.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>)

### AI overview

Ruby discloses CVE-2026-46727, a use-after-free vulnerability in the pthread-based getaddrinfo timeout handler. A race condition may cause a Ruby process to crash when an attacker delays DNS responses near the specified timeout. Ruby 4.0.5 fixes the issue.

### Source excerpt

A use-after-free vulnerability has been discovered in the pthread-based getaddrinfo timeout handler of Ruby. This vulnerability has been assigned the CVE identifier CVE-2026-46727. This issue has been fixed in Ruby 4.0.5. We recommend upgrading Ruby. Details A race condition exists in the timeout cancellation path of rb_getaddrinfo used by Addrinfo.getaddrinfo(..., timeout:) and Socket.tcp(..., resolv_timeout:). A remote attacker who can delay DNS responses near the specified timeout may cause the Ruby process to dereference freed memory and crash. Recommended action Please update to Ruby 4.0.5 or later. Workaround If you cannot upgrade immediately, avoid passing timeout: to Addrinfo.getaddrinfo and resolv_timeout: to Socket.tcp. Affected versions Ruby 4.0.0 through 4.0.4 Ruby 4.1.0-dev (master) before the fix Ruby 3.4 series and earlier are not affected. Credits Thanks to cantina-security for discovering this issue. Also thanks to shioimm for creating the patch. History Originally published at 2026-05-20 00:00:00 (UTC) Posted by hsbt on 20 May 2026

## Safe Optimistic Lock Coupling

DevFeed: [Safe Optimistic Lock Coupling](<https://devfeed.tech/articles/safe-optimistic-lock-coupling-25091.md>)

Original publisher: [Read original article](<https://databasearchitects.blogspot.com/2026/04/safe-optimistic-lock-coupling.html>)

Author: Thomas Neumann (noreply@blogger.com)

Published: 2026-04-29T10:22:56Z

Content type: article

Language: en

Sources: [Database Architects](<https://devfeed.tech/sources/database-architects.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>)

Tags: [concurrent](<https://devfeed.tech/tags/concurrent.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [locking](<https://devfeed.tech/tags/locking.md>), [locks](<https://devfeed.tech/tags/locks.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [performance](<https://devfeed.tech/tags/performance.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>), [thread](<https://devfeed.tech/tags/thread.md>), [typesafety](<https://devfeed.tech/tags/typesafety.md>)

### AI overview

The article explains how lock coupling can limit the scalability of concurrent binary-tree lookups because readers contend on locks, especially at the root. It presents Optimistic Lock Coupling, in which readers validate version numbers without writes, and discusses the race-condition risk when values are used before validation.

### Source excerpt

As the number of CPU cores keeps growing, the scalability of concurrent data structures becomes increasingly important. A data structure that works fine on 4 cores can become a bottleneck on 32, not because of algorithmic limitations, but because of how it synchronizes access. We illustrate that with a simple binary tree. Usually these data structures are protected by some kind of lock: struct Node { mutex lock; key_type key; value_type value; Node* left, *right; }; struct Tree { mutex lock; Node* root; }; When searching a value, we can traverse the data structure, lock the parts of the data we are currently touching, and release locks when we are done ("lock coupling"): option<value_type> Tree::lookup(key_type key) { lock.lock_shared(); mutex* currentLock = &lock; Node* iter = root; option<value_type> result; while (iter) { if (key == iter->key) { result = iter->value; break; } Node* next = (key < iter->key) ? iter->left : iter->right; if (next) next->lock.lock_shared(); currentLock->unlock(); currentLock = next ? &next->lock : nullptr; iter = next; } currentLock->unlock(); return result; } While conceptually simple, lock coupling has quite poor performance in practice. The problem is that it creates contention on the locks, in particular for the root node. Every lookup goes through the root node, thus the root node is constantly locked and unlocked. While there is no semantic contention between lookups, as all readers can read the root concurrently, there is physical contention on the lock itself, which limits scalability. This can be seen below, with concurrent lookups in a tree of 100,000 elements, executed on a 16-core / 32-thread 9950X3D. Lookup scalability: no locking vs lock coupling This contention problem can be solved by using Optimistic Lock Coupling, a synchronization technique where readers do not perform any writes. The key idea here is that writers lock as usual, and increase a version number when they are done updating. Readers read the version numb

## Ctrl-C in psql gives me the heebie-jeebies

DevFeed: [Ctrl-C in psql gives me the heebie-jeebies](<https://devfeed.tech/articles/ctrl-c-in-psql-gives-me-the-heebie-jeebies-5157.md>)

Original publisher: [Read original article](<https://neon.com/blog/ctrl-c-in-psql-gives-me-the-heebie-jeebies>)

Author: George MacKerron

Published: 2026-03-05T16:32:34Z

Content type: article

Language: en

Sources: [Blog -- Neon Docs](<https://devfeed.tech/sources/blog-neon-docs.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [client](<https://devfeed.tech/topics/client.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [TLS (Transport Layer Security)](<https://devfeed.tech/topics/tls.md>), [Process](<https://devfeed.tech/topics/process.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [command-line](<https://devfeed.tech/tags/command-line.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [process](<https://devfeed.tech/tags/process.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [sql](<https://devfeed.tech/tags/sql.md>), [tls](<https://devfeed.tech/tags/tls.md>)

### AI overview

Explains how Ctrl-C cancels a PostgreSQL query in psql: the client opens a separate connection and sends a CancelRequest targeting the original connection, which can create a race condition. It also examines the security implications of sending this request unencrypted despite TLS on the query connection.

### Source excerpt

There are a few different reasons to hit the brakes on a Postgres query. Maybe it's taking too long to finish. Maybe you realised you forgot to create an index that will make it orders of magnitude quicker. Maybe there's some reason the results are no longer needed. Or maybe you,...

## How LLMs Feed Your RE Habit: Following the Use-After-Free Trail in CLFS

DevFeed: [How LLMs Feed Your RE Habit: Following the Use-After-Free Trail in CLFS](<https://devfeed.tech/articles/how-llms-feed-your-re-habit-following-the-use-after-free-trail-in-clfs-39718.md>)

Original publisher: [Read original article](<https://clearbluejar.github.io/posts/how-llms-feed-your-re-habit-following-the-uaf-trail-in-clfs/>)

Author: clearbluejar

Published: 2026-02-03T06:15:00Z

Content type: tutorial

Language: en

Sources: [clearbluejar](<https://devfeed.tech/sources/clearbluejar.md>)

Topics: [Reverse Engineering](<https://devfeed.tech/topics/reverse-engineering.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [vulnerability](<https://devfeed.tech/topics/vulnerability.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Windows](<https://devfeed.tech/topics/windows.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>), [Logging](<https://devfeed.tech/topics/logging.md>)

Tags: [ghidra](<https://devfeed.tech/tags/ghidra.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [llms](<https://devfeed.tech/tags/llms.md>), [macos](<https://devfeed.tech/tags/macos.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>)

### AI overview

This article describes how LLMs and pyghidra-mcp support reverse engineering by tracing a use-after-free vulnerability in Windows Common Log File System (CLFS) through a patch diff. It explains CLFS, its Win32 and kernel-driver interfaces, and how a race condition can trigger the vulnerability.

### Source excerpt

Dive into how LLMs and pyghidra-mcp accelerate reverse engineering by tracing a UAF vulnerability in CLFS through a patch diff.

## Fast FRR Container Configuration

DevFeed: [Fast FRR Container Configuration](<https://devfeed.tech/articles/fast-frr-container-configuration-11333.md>)

Original publisher: [Read original article](<https://blog.ipspace.net/2026/02/netlab-frr-configuration/>)

Published: 2026-02-02T06:47:00Z

Content type: article

Language: en

Sources: [ipSpace.net blog](<https://devfeed.tech/sources/ipspace-net-blog.md>)

Topics: [Docker](<https://devfeed.tech/topics/docker.md>), [Containers](<https://devfeed.tech/topics/containers.md>), [Ansible](<https://devfeed.tech/topics/ansible.md>), [Bash](<https://devfeed.tech/topics/bash.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>)

Tags: [ansible](<https://devfeed.tech/tags/ansible.md>), [bash](<https://devfeed.tech/tags/bash.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [container](<https://devfeed.tech/tags/container.md>), [docker](<https://devfeed.tech/tags/docker.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [netlab](<https://devfeed.tech/tags/netlab.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>)

### AI overview

This article describes netlab's effort to configure FRR containers by executing generated Linux scripts through docker exec. It explains using shebangs to select vtysh or another interpreter, and reports integration-test issues including timing problems and a race condition involving parallel VLAN configuration.

### Source excerpt

After creating the infrastructure that generates the device configuration files within netlab (not in an Ansible playbook), it was time to try to apply it to something else, not just Linux containers. FRR containers were the obvious next target. netlab uses two different mechanisms to configure FRR containers: Data-plane features are configured with bash scripts using ip commands and friends. Control-plane features are configured with FRR's vtysh I wanted to replace both with Linux scripts that could be started with the docker exec command. Read more ...

## exploits.club Weekly Newsletter 85 -Fuzzing KSMBD, Kernel-Hack-Drill, Vibe-Crashing, And More

DevFeed: [exploits.club Weekly Newsletter 85 -Fuzzing KSMBD, Kernel-Hack-Drill, Vibe-Crashing, And More](<https://devfeed.tech/articles/exploits-club-weekly-newsletter-85-fuzzing-ksmbd-kernel-hack-drill-vibe-crashing-and-more-32642.md>)

Original publisher: [Read original article](<https://blog.exploits.club/exploits-club-weekly-newsletter-85-fuzzing-ksmbd-kernel-hack-drill-vibe-crashing-and-more/>)

Author: exploits.club

Published: 2025-09-04T15:00:32Z

Content type: article

Language: en

Sources: [exploits.club](<https://devfeed.tech/sources/exploits-club.md>)

Topics: [Fuzzing/Fuzz testing](<https://devfeed.tech/topics/fuzzing.md>), [Linux Kernel](<https://devfeed.tech/topics/linux-kernel.md>), [vulnerability](<https://devfeed.tech/topics/vulnerability.md>), [Security](<https://devfeed.tech/topics/security.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Exploit](<https://devfeed.tech/topics/exploit.md>), [Ubuntu](<https://devfeed.tech/topics/ubuntu.md>)

Tags: [exploits](<https://devfeed.tech/tags/exploits.md>), [fuzzing](<https://devfeed.tech/tags/fuzzing.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [linux-kernel](<https://devfeed.tech/tags/linux-kernel.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [security](<https://devfeed.tech/tags/security.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>)

### AI overview

The 85th exploits.club weekly newsletter highlights work on fuzzing improvements and vulnerability discovery in ksmbd, including 23 reported bugs. It also covers Kernel-Hack-Drill research on exploiting CVE-2024-50264, a Linux kernel socket race condition resulting in use-after-free, and related exploitation constraints.

### Source excerpt

New idea - let AI submit a different, buzzwordy talks to every CFP. What could go wrong? Annnnnnnnyways 👇 In Case You Missed It... 0-day Hunting Strategy with Eugene "Spaceraccoon" Lim - Following the release of his recent No Starch Press book, @spaceraccoonsec will be on tomorrow'

## exploits.club Weekly Newsletter 84 - Stealing Exploits, Competition Misconfigs, Android Physical Memory, And More

DevFeed: [exploits.club Weekly Newsletter 84 - Stealing Exploits, Competition Misconfigs, Android Physical Memory, And More](<https://devfeed.tech/articles/exploits-club-weekly-newsletter-84-stealing-exploits-competition-misconfigs-android-physical-memory-and-more-32641.md>)

Original publisher: [Read original article](<https://blog.exploits.club/exploits-club-weekly-newsletter-84-stealing-exploits-competition-misconfigs-android-physical-memory-and-more/>)

Author: exploits.club

Published: 2025-08-28T15:00:41Z

Content type: article

Language: en

Sources: [exploits.club](<https://devfeed.tech/sources/exploits-club.md>)

Topics: [Vulnerabilities](<https://devfeed.tech/topics/vulnerabilities.md>), [Exploit](<https://devfeed.tech/topics/exploit.md>), [ctf](<https://devfeed.tech/topics/ctf.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [HTTP](<https://devfeed.tech/topics/http.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [ctf](<https://devfeed.tech/tags/ctf.md>), [cve](<https://devfeed.tech/tags/cve.md>), [exploits](<https://devfeed.tech/tags/exploits.md>), [http](<https://devfeed.tech/tags/http.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [rce](<https://devfeed.tech/tags/rce.md>)

### AI overview

This newsletter highlights a reproduced in-the-wild CrushFTP exploit involving a race condition triggered by two HTTP requests, a HITCON CTF challenge involving AARCH64 PAC and BTI mitigations and exploitation, and a postmortem of Shellphish's AIxCC submission.

### Source excerpt

Someone recently reached out any said it was supposed to be "anyway" instead of....Annnnnnyways 👇 In Case You Missed It... BSides London CFP Open Now - get-em in! Honestly...nothing else really happened this week. I finished Sword Of Kaigen Resources And Write-Ups From This Week:

## Scaling Nextdoor's Datastores: Part 2

DevFeed: [Scaling Nextdoor's Datastores: Part 2](<https://devfeed.tech/articles/scaling-nextdoor-s-datastores-part-2-20341.md>)

Original publisher: [Read original article](<https://engblog.nextdoor.com/scaling-nextdoors-datastores-part-2-513922e4b4b1?source=rss----5e54f11cdfdf---4>)

Author: Tushar Singla

Published: 2025-03-19T15:08:32Z

Content type: article

Language: en

Sources: [Nextdoor](<https://devfeed.tech/sources/nextdoor.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Django](<https://devfeed.tech/topics/django.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [consistency](<https://devfeed.tech/topics/consistency.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>)

Tags: [consistency](<https://devfeed.tech/tags/consistency.md>), [database](<https://devfeed.tech/tags/database.md>), [database-scalability](<https://devfeed.tech/tags/database-scalability.md>), [django](<https://devfeed.tech/tags/django.md>), [orm](<https://devfeed.tech/tags/orm.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [rdbms](<https://devfeed.tech/tags/rdbms.md>), [read-replica](<https://devfeed.tech/tags/read-replica.md>), [replication](<https://devfeed.tech/tags/replication.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

The second installment of Nextdoor's datastore-scaling series examines the consistency problems caused by database read replicas. It describes how routing decisions became obscured by Django ORM abstractions, leading to read-after-write races, and explains how transactions were used as a workaround with negative effects on database load.

### Source excerpt

In the second installment of Nextdoor's "Scaling Nextdoor's Datastores" blog series, the Core-Services team discusses challenges faced after implementing database read replicas. Adding read replicas to an existing database is a very common pattern as applications or products evolve to handle increased demand. Typically, the implementation details are hand waved and it's assumed that this strategy will work. However, that is rarely the case, and we'll dive into some more of the intricacies around the implementation. Initial Attempt When replicas were first introduced in the Nextdoor stack, we gave the product engineers latitude to choose when they wanted to have their query routed to a read replica or to the primary. This was done by leveraging the existing routing mechanism in our ORM, Django. This seemed like the right idea at the time because the product engineers had the most context around consistency requirements within their changes and load characteristics of their product feature. Therefore, they would have the best ability to judge which node to send their query to. However, as our business logic evolved and became more feature-rich, product engineers began to add abstraction layers to help abstract complex operations away from business logic. In this design evolution there is a high frequency read, followed by a low frequency conditional write, followed by a read. The read performed after the write should be routed to the primary, but that may get buried in abstractions and this requirement regressed. The explicit routing decisions engineers made became buried and subsequently created a serious problem for users of these abstractions. If one abstraction method was performing a write and another a read, they could not safely be used together due to read-after-write consistency issues. Due to replication lag between the primary and replica databases, a race condition arises when the application attempts to read data from a replica after performing a write. W

## Wednesday, April 3, 2024 Security Releases

DevFeed: [Wednesday, April 3, 2024 Security Releases](<https://devfeed.tech/articles/wednesday-april-3-2024-security-releases-2868.md>)

Original publisher: [Read original article](<https://nodejs.org/en/blog/vulnerability/april-2024-security-releases>)

Published: 2024-04-03T03:00:00Z

Content type: release

Language: en

Sources: [Node.js Blog](<https://devfeed.tech/sources/node-js-blog.md>)

Topics: [Node.js](<https://devfeed.tech/topics/node-js.md>), [Security](<https://devfeed.tech/topics/security.md>), [releases](<https://devfeed.tech/topics/releases.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>)

Tags: [http](<https://devfeed.tech/tags/http.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [releases](<https://devfeed.tech/tags/releases.md>), [security](<https://devfeed.tech/tags/security.md>), [server](<https://devfeed.tech/tags/server.md>), [vulnerabilities](<https://devfeed.tech/tags/vulnerabilities.md>)

### AI overview

The Node.js Project announced April 3, 2024 security releases for the 18.x, 20.x, and 21.x release lines. The updates address vulnerabilities involving HTTP/2 server availability and HTTP request smuggling, along with dependency updates to llhttp and undici.

### Source excerpt

Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.

## Clouds, caches and connection conundrums

DevFeed: [Clouds, caches and connection conundrums](<https://devfeed.tech/articles/clouds-caches-and-connection-conundrums-11718.md>)

Original publisher: [Read original article](<https://incident.io/blog/clouds-caches-and-connection-conundrums>)

Author: Ben Wheatley

Published: 2023-09-26T08:13:00Z

Content type: article

Language: en

Sources: [The incident.io Blog](<https://devfeed.tech/sources/the-incident-io-blog.md>)

Topics: [Cloud](<https://devfeed.tech/topics/cloud.md>), [migration](<https://devfeed.tech/topics/migration.md>), [incident](<https://devfeed.tech/topics/incident.md>), [Cache](<https://devfeed.tech/topics/cache.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Google](<https://devfeed.tech/topics/google.md>), [API](<https://devfeed.tech/topics/api.md>), [data](<https://devfeed.tech/topics/data.md>), [Server](<https://devfeed.tech/topics/server.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [cache](<https://devfeed.tech/tags/cache.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [data](<https://devfeed.tech/tags/data.md>), [google](<https://devfeed.tech/tags/google.md>), [google-cloud](<https://devfeed.tech/tags/google-cloud.md>), [incident](<https://devfeed.tech/tags/incident.md>), [incident-channel](<https://devfeed.tech/tags/incident-channel.md>), [incident-management](<https://devfeed.tech/tags/incident-management.md>), [incident-response](<https://devfeed.tech/tags/incident-response.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [migration](<https://devfeed.tech/tags/migration.md>), [network](<https://devfeed.tech/tags/network.md>), [outage](<https://devfeed.tech/tags/outage.md>), [post-mortem](<https://devfeed.tech/tags/post-mortem.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [server](<https://devfeed.tech/tags/server.md>), [slack-incident](<https://devfeed.tech/tags/slack-incident.md>)

### AI overview

This developer article recounts an infrastructure migration into Google Cloud that led to repeated Postgres connection timeouts and unusually high connection creation rates. It describes investigating a possible race condition involving expired connections, applying changes that reduced new connections, and then examining sporadic memcached timeout issues affecting API responses.

### Source excerpt

During a recent infrastructure migration into Google Cloud, we kept running into a pesky issue without a clear cause. Here, we dive into the twists and turns we took to finally figure out what the smoking gun was.

## Application-as-a-Function Thinking

DevFeed: [Application-as-a-Function Thinking](<https://devfeed.tech/articles/application-as-a-function-thinking-26037.md>)

Original publisher: [Read original article](<http://doridori.github.io//Architecture-Application-as-a-Function/>)

Author: SystemDotRun

Published: 2022-10-11T00:00:00Z

Content type: article

Language: en

Sources: [SystemDotRun](<https://devfeed.tech/sources/systemdotrun.md>)

Topics: [Development](<https://devfeed.tech/topics/development.md>), [Code](<https://devfeed.tech/topics/code.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [event driven](<https://devfeed.tech/topics/event-driven.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [event-driven](<https://devfeed.tech/tags/event-driven.md>), [oop](<https://devfeed.tech/tags/oop.md>), [productivity](<https://devfeed.tech/tags/productivity.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

The article argues that placing a stateless pure function at the core of an application, within a functional-core imperative-shell architecture, can simplify testing and reduce complexity. It discusses how scattered requirements, weak documentation, poor tests, naming problems, race-prone object-oriented state, low cohesion, and event handling can make systems harder to understand and maintain.

### Source excerpt

TL;DR Architecting an application with a pure function at its core can be a first step towards the "functional-core imperative shell" ideal, which can simplify testing and lower an applications complexity bar. Why? Simplification. As a novel alternative to KISS, we start with a quote from The Grug Brained Developer: complexity very, very bad And for completeness: Complexity: a measure of how difficult it is to understand how a system will behave or to predict the consequences of changing it For many applications the challenge is how to simply & correctly represent a large number of domain requirements in code, and how to raise the complexity-bar sufficently to enable a high degree of engineer productivity & runtime stability . A low complexity-bar reduces the amount of time it takes for a developer to get to the brain-meltdown-event-horizon-like state after which completion of new work slows down expontentially due to sheer codebase and test suite complexity which results in low grokability (i.e. code which is hard to understand or follow), an increasing degree of emergent behaviour, a higher probability of introducing regressions and generally, just slow development. A high complexity-bar conversely allows a desired order and serenity to take hold and more time spent on adding value as opposed to fire-fighting. I have observed different reasons for a low complexity bar, including: Domain requirements being spread throughout all codebase components Non-existent / incomplete / disorganised domain requirements documentation A non-existent / disorganised / bloated / poorly performing test suite Poor naming Race condition rich OOP state manipulations Low architectural cohesion across a codebase / team In addition if your application is highly event driven (user input / network / OS / peripherals / sensors) not having a simple approach to process incoming events can lead to chaotic code. Multiply this if you are working within a sensitive domain which has strict requirem

## Why We Chose Go

DevFeed: [Why We Chose Go](<https://devfeed.tech/articles/why-we-chose-go-27987.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/2020-03-02-whywechosego/>)

Author: Martin Mai Software; Site Reliability Engineer GitHub profile

Published: 2020-03-02T00:00:00Z

Content type: article

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [gRPC](<https://devfeed.tech/topics/grpc.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [OAuth 2.0](<https://devfeed.tech/topics/oauth2.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [devops](<https://devfeed.tech/tags/devops.md>), [go](<https://devfeed.tech/tags/go.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>)

### AI overview

trivago explains why its team chose Go for a greenfield Recent Searches service. The article discusses Go's concurrency support and race detector in the context of a gRPC service running in Kubernetes and authenticated through OAuth2.

### Source excerpt

To the outside, trivago appears to be one single software product providing our popular hotel meta search. Behind the scenes, however, it is home to dozens of projects and tools to support it. T...

## Mention's CTO journey to 400,000 users

DevFeed: [Mention's CTO journey to 400,000 users](<https://devfeed.tech/articles/mention-s-cto-journey-to-400-000-users-34701.md>)

Original publisher: [Read original article](<https://medium.com/unexpected-token/mention-s-cto-journey-to-400-000-users-f22dc242eec?source=rss----2d2624499d2---4>)

Author: Hexa

Published: 2015-10-22T12:17:15Z

Content type: article

Language: en

Sources: [eFounders](<https://devfeed.tech/sources/efounders.md>)

Topics: [App](<https://devfeed.tech/topics/app.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [Crawler](<https://devfeed.tech/topics/crawler.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [API](<https://devfeed.tech/topics/api.md>), [Kafka](<https://devfeed.tech/topics/kafka.md>), [Redis](<https://devfeed.tech/topics/redis.md>), [Percona](<https://devfeed.tech/topics/percona.md>), [backups](<https://devfeed.tech/topics/backups.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [backups](<https://devfeed.tech/tags/backups.md>), [developer](<https://devfeed.tech/tags/developer.md>), [development](<https://devfeed.tech/tags/development.md>), [dns](<https://devfeed.tech/tags/dns.md>), [go](<https://devfeed.tech/tags/go.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [percona](<https://devfeed.tech/tags/percona.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [redis](<https://devfeed.tech/tags/redis.md>), [startup](<https://devfeed.tech/tags/startup.md>), [tech](<https://devfeed.tech/tags/tech.md>), [users](<https://devfeed.tech/tags/users.md>)

### AI overview

Mention's co-founder and CTO describes the technical challenges involved in growing the real-time monitoring application to 400,000 users. The article covers high-concurrency web crawling, a libc DNS resolver race condition, and the use of Go as a workaround. It also explains Mention's storage architecture using Percona MySQL, Redis for caching, Kafka for messaging, and incremental backups.

### Source excerpt

Mention is a real-time monitoring application used to track and analyze trends and e-reputation in a very complete and intuitive way. Co-founded in 2010, it now counts 400,000 users across the world. This impressive growth rate not only implies great marketing talent but also impressive technical achievements. Arnaud le Blanc, Mention's co-founder and CTO, tells us about how he got Mention there. You gotta love technical challenges "When we developed Mention, our main competitor was Google Alerts, which feels a little like being David versus Goliath at first. But then it became one of the reasons I like my job: it is very challenging. Getting to this point of a product development involves a true entrepreneurial mindset. Before being Mention's CTO, I was a developer and then the lead developer working on the media monitoring feature at Pressking. eFounders offered me to become Mention's co-founder. I might not have thought of myself as an entrepreneur before, although today, I really feel like Mention is my product: I've built it together with my co-founders. Building an application like Mention is full of technical challenges. We handle a large amount of data, crawl thousands of web page per second, built an open API for our own apps, and use lots of third-party APIs." FOCUS: a challenge overcome when developing Mention's web crawler Since Mention crawls a large amount of web pages in parallel, there is a point when the crawler reaches a high concurrency level and stresses the OS: that is when we got to the limit of our system. In our case, these limits entailed the appearance of a race condition in the libc's DNS resolver. libc was sending over DNS queries on random unrelated file descriptors, which was leading to weird behaviors. The bug was reported and fixed a few months later, but in the meantime, we had to use the plain-Go DNS resolve, which happened to work really well. "At Mention, several millions of Mentions are inserted in user feeds per day (see infogra

## Upsert lands in PostgreSQL 9.5 - A first look

DevFeed: [Upsert lands in PostgreSQL 9.5 - A first look](<https://devfeed.tech/articles/upsert-lands-in-postgresql-9-5-a-first-look-41176.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2015/05/08/Upsert-lands-in-PostgreSQL-9.5-A-first-look/>)

Author: Map

Published: 2015-05-08T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Exception](<https://devfeed.tech/topics/exception.md>)

Tags: [databases](<https://devfeed.tech/tags/databases.md>), [exception](<https://devfeed.tech/tags/exception.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>)

### AI overview

This article gives an early look at PostgreSQL 9.5's upsert feature, which creates a record or updates the existing record when a conflict occurs. It explains the feature through a product-import example and discusses how handling the operation in a single transaction can avoid race conditions and duplicate records.

### Source excerpt

If you've followed anything I've written about Postgres, you know that I'm a fan. At the same time you know that there's been one feature that so many other databases have, which Postgres lacks and it causes a huge amount of angst for not being in Postgres... Upsert. Well the day has come, it's finally committed and will be available in Postgres 9.5. Sure we're still several months away from Postgres 9.5 being released, anywhere from 3-6 months as a best guess. That doesn't mean we can't take a first look at this feature. Though before we get into it a few special call outs of thanks to Peter Geoghegan of the Heroku Postgres team for being the primary author on it, Andres Freund who recently just joined Citus Data for his heavy contributions, and Heikki Linnakangas as well for his contributions. And now onto the exploration. Upsert is the common name, but if you're unfamiliar upsert is essentially create or update - Create this new record, but if a conflict exists update it. Let's take a practical example. Assume you have a web scraper that imports product information into a table. Each product has a UPC code, title, description, and link. There's a unique constraint on the UPC code. Now, if your web scraper tries to insert a new product, and a product with the same UPC already exists, you'd usually get an error. But you don't want the query to fail, you'd want to update the existing product instead. Maybe with a new image, maybe a new description, whatever have you, but I don't want it to blow up... I simply want to capture the new data and save it. So before: Insert a record... Exception this violates a unique constraint... Let your app figure out what to do. protip: often applications would try to work around this, but you can run a chance of a race condition and duplicate records if there's a conflict. TLDR; it's not a perfect solution. Now: Insert a record... There's a unique constraint violation... Okay, let's just update all the new record's fields inside a single transa

## Ice Cream Makers and Data Races Part II

DevFeed: [Ice Cream Makers and Data Races Part II](<https://devfeed.tech/articles/ice-cream-makers-and-data-races-part-ii-22102.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2014/06/ice-cream-makers-and-data-races-part-ii.html>)

Published: 2014-06-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [code](<https://devfeed.tech/tags/code.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [goroutines](<https://devfeed.tech/tags/goroutines.md>), [interface](<https://devfeed.tech/tags/interface.md>), [memory](<https://devfeed.tech/tags/memory.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>)

### AI overview

This article examines a data race in Go caused by unsynchronized reads and writes to an interface-typed variable. It explains how partial writes can cause method implementations for different receiver types to operate on incompatible memory representations.

### Source excerpt

Introduction Dave Cheney published a post called Ice Cream Makers and Data Races. The post showed an example of an interesting data race that can occur when using an interface typed variable to make a method call. If you have not read the post yet please do. Once you read the post you will discover that the problem lies with the fact that an interface value is implemented internally using a two word header and that the Go memory model states only writes to a single word are atomic. The program in the post shows a race condition that allows two goroutines to perform a read and write operation at the same time against an interface value. Not synchronizing this read and write allows the read to observe a partial write to the interface value. This allows the method implementation for the Ben type to operate against a value of the Jerry type and visa versa. In Dave's example, the layout of the Ben and Jerry structs were identical in memory, so they were in some sense compatible. Dave suggested the chaos that would occur if they had different memory representations. This is because each implementation of the Hello method assumes the code is operating against values of the receiver type. When this bug surfaces, this is no longer the case. To give you a visual view of this suggested chaos, I am going to change the declaration of the Jerry type in two different ways. Both changes will give you some better insight into the interworking of interface types and memory. First Code Change Let's review the code and see the first set of changes. My changes to the original code are in bold:

## A Go select Bug That Repeatedly Launches a Goroutine After an Interrupt

DevFeed: [A Go select Bug That Repeatedly Launches a Goroutine After an Interrupt](<https://devfeed.tech/articles/my-channel-select-bug-22081.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2013/10/my-channel-select-bug.html>)

Published: 2013-10-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [bug](<https://devfeed.tech/topics/bug.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code](<https://devfeed.tech/tags/code.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [os](<https://devfeed.tech/tags/os.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

### AI overview

This Go tutorial examines a select statement whose case expression launches a goroutine. After an interrupt, the loop continues and evaluates that expression again, launching the worker repeatedly. The article also identifies a separate race condition involving the shutdown flag.

### Source excerpt

I was testing new functionality on a program that is already running in production when suddenly the code behaved very badly. What I saw shocked me and then it became obvious why it happened. I also have a race condition just waiting to be a problem. I have tried to provide a simplified version of the code and the two bugs. package main import ( "fmt" "os" "os/signal" "time" ) var Shutdown bool = false func main() { sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt) for { select { case <-sigChan: Shutdown = true continue case <-func() chan struct{} { complete := make(chan struct{}) go LaunchProcessor(complete) return complete }(): return } } } func LaunchProcessor(complete chan struct{}) { defer func() { close(complete) }() fmt.Printf("Start Work\n") for count := 0; count < 5; count++ { fmt.Printf("Doing Work\n") time.Sleep(1 * time.Second) if Shutdown == true { fmt.Printf("Kill Early\n") return } } fmt.Printf("End Work\n") } The idea behind this code is to run a task and terminate. It allows the operating system to request the program to terminate early. I always like shutting down the program cleanly when possible. The sample code creates a channel that is bound to an operating system signal and looks for <ctrl> C from the terminal window. If <ctrl> C is issued, the Shutdown flag is set to true and the program continues back into the select statement. The code also spawns a Go routine that performs the work. That routine checks the Shutdown flag to determine if the program needs to terminate early. Bug Number 1 Take a look at this part of the code: case <-func() chan struct{} { complete := make(chan struct{}) go LaunchProcessor(complete) return complete }(): I thought I was being so clever when I wrote this code. I thought it would be cool to execute a function on the fly to spawn the Go routine. It returns a channel that the select waits on to be told the work is complete. When the Go routine is done it closes the channel and the program term

## Detecting Race Conditions With Go

DevFeed: [Detecting Race Conditions With Go](<https://devfeed.tech/articles/detecting-race-conditions-with-go-22070.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2013/09/detecting-race-conditions-with-go.html>)

Published: 2013-09-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [code](<https://devfeed.tech/tags/code.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [logging](<https://devfeed.tech/tags/logging.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

### AI overview

This tutorial explains race conditions in Go and demonstrates how Go's race detector can identify unsynchronized access to shared resources. It uses a concurrent program that increments a shared counter and shows how to build and run it with the -race option.

### Source excerpt

I always find it interesting when I realize that something I have been practicing or dealing with for a long time has a name. This time it happens to be race conditions. This is something you can't avoid thinking about as soon as you have more than one routine sharing any kind of resource. If you're not thinking about race conditions in your code, now is the time. A race condition is when two or more routines have access to the same resource, such as a variable or data structure and attempt to read and write to that resource without any regard to the other routines. This type of code can create the craziest and most random bugs you have ever seen. It usually takes a tremendous amount of logging and luck to find these types of bugs. Over the years I have really perfected my logging skills to help identify these problems when they occur. Back in June with Go version 1.1, the Go tooling introduced a race detector. The race detector is code that is built into your program during the build process. Then once your program is running, it is able to detect and report any race conditions it finds. It is seriously cool and does an incredible job in identifying the code that is the culprit. Let's take a very simple program that contains a race condition and build the code with the race detector.

## JavaScript Callbacks and Flow Control in Node.js

DevFeed: [JavaScript Callbacks and Flow Control in Node.js](<https://devfeed.tech/articles/it-ain-t-about-the-callbacks-38929.md>)

Original publisher: [Read original article](<https://idea.popcount.org/2013-09-05-it-aint-about-the-callbacks>)

Author: Marek

Published: 2013-09-04T22:00:00Z

Content type: article

Language: en

Sources: [Marek Majkowski](<https://devfeed.tech/sources/marek-majkowski.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [Streams](<https://devfeed.tech/topics/streams.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [streams](<https://devfeed.tech/tags/streams.md>)

### AI overview

This article argues that callback-based programming can encourage poor solutions when flow control is overlooked. It uses a Node.js echo server to explain connection-acceptance limits, unbounded buffering, and how Node.js Streams provide basic flow control.

### Source excerpt

It ain't about the callbacks... ... it's about the flow control Programmers tend to be very opinionated about programming with callbacks. It's just a programming style, not a big deal usually, but it becomes an issue when a platform forces you to use only the callback style. I'm talking about you, JavaScript. In my opinion people forget an important point in the discussion about callbacks.

## Integration Testing Resque with Cucumber

DevFeed: [Integration Testing Resque with Cucumber](<https://devfeed.tech/articles/integration-testing-resque-with-cucumber-15696.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/integration-testing-resque-with-cucumber>)

Author: Square Engineering

Published: 2010-08-16T16:00:00Z

Content type: tutorial

Language: en

Sources: [Square Corner Blog RSS Feed](<https://devfeed.tech/sources/square-corner-blog-rss-feed.md>)

Topics: [Cucumber](<https://devfeed.tech/topics/cucumber.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [race-condition](<https://devfeed.tech/topics/race-condition.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Processes](<https://devfeed.tech/topics/processes.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [integration](<https://devfeed.tech/tags/integration.md>), [integration-testing](<https://devfeed.tech/tags/integration-testing.md>), [process](<https://devfeed.tech/tags/process.md>), [processes](<https://devfeed.tech/tags/processes.md>), [queue](<https://devfeed.tech/tags/queue.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

This article explains how Square integration-tests Resque asynchronous background jobs with Cucumber. It addresses race conditions by forking a Resque worker from the Cucumber process, pausing the worker, and using signal handling to release it, wait for queued jobs to finish, and pause it again.

### Source excerpt

Processing asynchronous jobs deterministically

[Next page](<https://devfeed.tech/topics/race-condition.md?cursor=WyIyMDEwLTA4LTE2VDE2OjAwOjAwKzAwOjAwIiwgIjk4OWM0MDNmLTY2YmMtNDJmOS04ZTBmLTU0OWU1YTZkYmI4NiJd>)