# Concurrency Trap #2: Incomplete Work

DevFeed: [Concurrency Trap #2: Incomplete Work](<https://devfeed.tech/articles/concurrency-trap-2-incomplete-work-22144.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2019/04/concurrency-trap-2-incomplete-work.html>)

Published: 2019-04-18T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [integrity](<https://devfeed.tech/topics/integrity.md>), [Latency](<https://devfeed.tech/topics/latency.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [blog](<https://devfeed.tech/tags/blog.md>), [concurrency](<https://devfeed.tech/tags/concurrency.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>), [integrity](<https://devfeed.tech/tags/integrity.md>), [latency](<https://devfeed.tech/tags/latency.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

This article explains incomplete work as a Go concurrency trap: a program exits when the main function returns without waiting for non-main goroutines, which can terminate important work prematurely. It discusses possible integrity problems, including database or filesystem corruption and data loss, and introduces an asynchronous event-tracking example motivated by latency concerns.

## Source excerpt

Introduction In my first post on Goroutine Leaks, I mentioned that concurrency is a useful tool but it comes with certain traps that don't exist in synchronous programs. To continue with this theme, I will introduce a new trap called incomplete work. Incomplete work occurs when a program terminates before outstanding Goroutines (non-main goroutines) complete. Depending on the nature of the Goroutine that is being terminated forcefully, this may be a serious problem.