Kevin Kuehler 5d0efce278 engine: lang: util: Kill race in socketset
After some investigation, it appears that SocketSet.Shutdown() and
SocketSet.Close() are not synchronous operations. The sendto system call
called in SocketSet.Shutdown() is not a blocking send. That means there
is a race in which SocketSet.Shutdown() sends a message to a file
descriptor to unblock select, while SocketSet.Close() will close the
file descriptor that the message is being sent to. If SocketSet.Close()
wins the race, select is listening on a dead file descriptor and will
hang indefinitely.

This is fixed in the current master by putting SocketSet.Close() inside
of the goroutine in which data from the socket is being received. It
relies on SocketSet.Shutdown() being called to terminate the goroutine.
While this works most of the time, there is a race here. All the
goroutines can also be terminated by a closeChan. If the goroutine
receives an event (thus unblocking select) and then closeChan is
triggered, both SocketSet.Shutdown() and SocketSet.Close() race, leading
to undefined behavior.

This patch ensures the ordering of the two function calls by pulling
them both out of the goroutine and separating them with a WaitGroup.

Co-authored-by: James Shubin <james@shubin.ca>
2019-01-22 20:59:17 -08:00
2016-09-18 05:47:33 -04:00
2018-02-24 12:04:23 +01:00
2019-01-17 20:07:24 -05:00
2018-12-21 06:22:12 -05:00
2018-12-21 06:22:12 -05:00
2018-01-03 21:22:07 -05:00
2018-12-21 06:22:12 -05:00
2018-12-21 06:22:12 -05:00
2018-12-21 06:22:12 -05:00
2018-12-11 01:46:17 -05:00
2016-05-21 11:08:14 +02:00
2019-01-11 04:38:12 -05:00
2018-02-23 19:59:55 -05:00
2017-09-11 18:07:47 -04:00
2018-01-03 21:22:07 -05:00
2018-01-03 21:22:07 -05:00
2018-04-19 01:10:58 -04:00
2016-01-04 21:00:13 -05:00
2015-09-25 01:16:03 -04:00
2018-06-21 19:21:41 -04:00
2015-09-25 01:16:03 -04:00
2017-09-11 18:07:47 -04:00
2018-06-12 17:40:18 -04:00
2018-05-19 09:21:06 +02:00

mgmt: next generation config management!

mgmt!

Go Report Card Build Status GoDoc IRC Patreon Liberapay

Community:

Come join us in the mgmt community!

Medium Link
IRC #mgmtconfig on Freenode
Twitter @mgmtconfig & #mgmtconfig
Mailing list mgmtconfig-list@redhat.com
Patreon purpleidea on Patreon
Liberapay purpleidea on Liberapay

Status:

Mgmt is a next generation automation tool. It has similarities to other tools in the configuration management space, but has a fast, modern, distributed systems approach. The project contains an engine and a language. Please have a look at an introductory video or blog post.

Mgmt is a fairly new project. It is usable today, but not yet feature complete. With your help you'll be able to influence our design and get us to 1.0 sooner! Interested developers should read the quick start guide.

Documentation:

Please read, enjoy and help improve our documentation!

Documentation Additional Notes
quick start guide for mgmt developers
frequently asked questions for everyone
general documentation for everyone
language guide for everyone
function guide for mgmt developers
resource guide for mgmt developers
style guide for mgmt developers
godoc API reference for mgmt developers
prometheus guide for everyone
puppet guide for puppet sysadmins
development for mgmt developers

Questions:

Please ask in the community! If you have a well phrased question that might benefit others, consider asking it by sending a patch to the FAQ section. I'll merge your question, and a patch with the answer!

Roadmap:

Feel free to grab one of the straightforward #mgmtlove issues if you're a first time contributor to the project or if you're unsure about what to hack on! Please see: TODO.md for a list of upcoming work and TODO items. Please get involved by working on one of these items or by suggesting something else!

Bugs:

Please set the DEBUG constant in main.go to true, and post the logs when you report the issue. Bonus points if you provide a shell or OMV reproducible test case. Feel free to read my article on debugging golang programs.

Patches:

We'd love to have your patches! Please send them by email, or as a pull request.

On the web:

Read what people are saying and publishing about mgmt!

Happy hacking!

Description
No description provided
Readme 12 MiB
Languages
Go 95%
Shell 2.3%
Yacc 0.9%
Makefile 0.8%
JavaScript 0.4%
Other 0.6%