Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Sebastiaan van Stijn 9940093291
Merge pull request #38 from austinvazquez/add-security-policy
Add project SECURITY.md policy
2024-11-14 19:30:25 +01:00
Austin Vazquez 2928df5612
Add project SECURITY.md policy
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-18 03:39:34 +00:00
Sebastiaan van Stijn 969db071c8
Merge pull request #33 from austinvazquez/define-ci
Add basic GitHub Actions CI
2024-10-17 20:57:36 +02:00
Austin Vazquez 1be0be15b3
Add basic GitHub Actions CI
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2024-10-17 18:50:26 +00:00
Tibor Vass e31b211e4f
Merge pull request #32 from tiborvass/fix-alignment
fix alignment for 32bit systems
2019-08-05 17:42:12 -07:00
Tibor Vass d7e97b9abb fix alignment for 32bit systems
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-08-06 00:40:41 +00:00
Stephen Day 9461782956 Merge pull request #22 from mcandre/update-logrus
update to github.com/sirupsen/logrus v1.0.0
2017-07-21 12:00:31 -07:00
Andrew Pennebaker 5cd3e7afe1 update to github.com/sirupsen/logrus v1.0.0
Signed-off-by: Andrew Pennebaker <apennebaker@datapipe.com>
2017-07-06 17:03:39 -05:00
Stephen Day aa2e3b613f Merge pull request #17 from NanXiao/fix-typo-in-queue
Fix typo in queue.go.
2016-09-06 14:07:42 -07:00
Stephen Day 37d35add50 Merge pull request #20 from LK4D4/fix_log_race
all: fix sync.Once copy
2016-08-29 14:59:57 -04:00
Alexander Morozov 834ad85c70 all: fix sync.Once copy
We're doing object copy on String call, but it makes race detector
angry: copy of sync.Once and changing its state at the same time. Also,
it fixes three vet warnings about passing lock by value.

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-08-29 10:23:38 -07:00
Stephen Day 18b43f1bc8 Merge pull request #19 from aaronlehmann/avoid-logging-sink-2
Avoid recursion in String methods
2016-08-26 16:51:36 -04:00
Aaron Lehmann 5ca49ebc1c Avoid recursion in String methods
Let's try this once more...

Use a map instead of the same object type so that the String method
doesn't infinitely recurse.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-08-26 13:43:31 -07:00
Stephen Day a7969c8a34 Merge pull request #18 from aaronlehmann/avoid-logging-sink
Don't include serialization of sink in log messages
2016-08-26 16:13:32 -04:00
Aaron Lehmann 5110791f2d Don't include serialization of sink in log messages
Some log messages add an events.sink field whose value is the actual
sink object. Trying to log this can cause a data race, because some
sinks contain a sync.Once field:

WARNING: DATA RACE
Read at 0x00c42004beb0 by goroutine 75:
  reflect.Value.Int()
      /usr/local/go/src/reflect/value.go:886 +0x192
  fmt.(*pp).printValue()
      /usr/local/go/src/fmt/print.go:703 +0x39f6
  fmt.(*pp).printValue()
      /usr/local/go/src/fmt/print.go:764 +0x2d45
  fmt.(*pp).printValue()
      /usr/local/go/src/fmt/print.go:764 +0x2d45
  fmt.(*pp).printValue()
      /usr/local/go/src/fmt/print.go:764 +0x2d45
  fmt.(*pp).printValue()
      /usr/local/go/src/fmt/print.go:835 +0x2448
  fmt.(*pp).printArg()
      /usr/local/go/src/fmt/print.go:668 +0x1a3
  fmt.(*pp).doPrint()
      /usr/local/go/src/fmt/print.go:1113 +0xe3
  fmt.Fprint()
      /usr/local/go/src/fmt/print.go:215 +0x69
  github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus.(*TextFormatter).appendKeyValue()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus/text_formatter.go:157
+0x134
  github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus.(*TextFormatter).Format()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus/text_formatter.go:91
+0x6e6
  github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus.(*Entry).Reader()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus/entry.go:44
+0x73
  github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus.Entry.log()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus/entry.go:94
+0x1f6
  github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus.(*Entry).Debug()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/Sirupsen/logrus/entry.go:119
+0x106
  github.com/docker/swarmkit/vendor/github.com/docker/go-events.(*Queue).run()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/docker/go-events/queue.go:85
+0x2eb

Previous write at 0x00c42004beb0 by goroutine 67:
  sync/atomic.AddInt32()
      /usr/local/go/src/runtime/race_amd64.s:269 +0xb
  sync.(*Mutex).Unlock()
      /usr/local/go/src/sync/mutex.go:109 +0x54
  sync.(*Once).Do()
      /usr/local/go/src/sync/once.go:46 +0xa6
  github.com/docker/swarmkit/vendor/github.com/docker/go-events.(*Channel).Close()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/vendor/github.com/docker/go-events/channel.go:45
+0x79
  github.com/docker/swarmkit/manager/state/watch.(*Queue).CallbackWatch.func1()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/manager/state/watch/watch.go:48
+0x9d
  github.com/docker/swarmkit/manager/state/watch.(*Queue).CallbackWatch.func2()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/manager/state/watch/watch.go:62
+0x126
  github.com/docker/swarmkit/ca.(*Server).Run()
      /home/ubuntu/.go_workspace/src/github.com/docker/swarmkit/ca/server.go:380
+0xb25

To avoid the data race, add String methods to objects that aren't safe
to serialize directly. These serialize a copy that excludes the
sync.Once.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-08-26 13:06:12 -07:00
Nan Xiao bb8f5ce886 Fix typo in queue.go.
Signed-off-by: Nan Xiao <nan@chinadtrace.org>
2016-08-25 03:11:23 -04:00
Stephen Day 23780caac6 Merge pull request #15 from docker/channel-close-race
channel: address close race condition
2016-08-19 15:47:01 -07:00
Stephen J Day eb6518f25a
sinks: address close race condition
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-08-19 15:35:21 -07:00
Stephen Day afb2b9f2c2 Merge pull request #12 from thaJeztah/fix-copyright
fix copyright, add contributing and maintainers
2016-06-04 12:51:36 -07:00
Sebastiaan van Stijn b3d92db749
fix copyright, add contributing and maintainers
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-06-04 15:01:10 +02:00
Stephen Day b82591c0ff Merge pull request #10 from LK4D4/fix_chan_comment
channel: fix comment about channel buffer
2016-06-01 15:34:06 -07:00
Stephen Day 75bd8e1de6 Merge pull request #11 from aaronlehmann/dropped-events
Change "dropped events" warning to debug-level log message
2016-06-01 15:30:44 -07:00
Aaron Lehmann cc270ab7dc Change "dropped events" warning to debug-level log message
In a project where I use go-events, quite a few unit tests and
benchmarks read from a queue until they find what they're looking for,
and then stop reading. There may be more events published to the queue
afterwards, but there's no non-racy way to consume all of them and still
have the test terminate. Thus, these tests and benchmarks tend to log
many `WARN[0004] eventqueue: dropped event` messages.

Change this to the debug log level, so applications and unit tests which
use go-events are not forced to always consume all events to suppress
these messages.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-06-01 15:22:52 -07:00
Alexander Morozov 3718f92456 channel: fix comment about channel buffer
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-05-09 12:20:14 -07:00
Stephen Day 882f161010 Merge pull request #7 from docker/exponential-backoff
retry: implement exponential backoff for event retry
2016-03-31 15:17:39 -07:00
Stephen J Day 39718a2649 retry: implement exponential backoff for event retry
To complement circuit breaker, we now have an exponential backoff retry
strategy. The common increasing bound strategy is implemented.

A small bug was exposed in the implementation that blocked the retry
forever if the strategy did not probe. Now, we simply wait for the retry
and proceed. This may change behavior in the breaker case, but is more
correct.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-03-31 15:14:15 -07:00
Aaron Lehmann 9e2c9c6318 Merge pull request #8 from docker/use-time-after
retry: use time.After rather than manage timer lifecycle
2016-03-31 15:02:13 -07:00
Stephen J Day c738c6a307 retry: use time.After rather than manage timer lifecycle
After some analysis of stdlib, we found that time.After is sufficient to
avoid leaking a goroutine. This is because the send on the time channel
is actaully non-blocking.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-03-31 14:45:55 -07:00
Stephen Day 2e7d352816 Merge pull request #5 from docker/address-typos
README: address a few typos
2016-03-22 23:00:50 -07:00
Stephen J Day 7f8e3610c5 README: address a few typos
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-03-22 22:59:58 -07:00
Stephen Day 8dc8aaae07 Merge pull request #3 from docker/circle-status-badge
build: add circleci status badge
2016-03-22 22:52:51 -07:00
Stephen J Day 5c74e64558 build: add circleci status badge
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-03-22 22:50:59 -07:00
Stephen J Day bb7a0c6805 events: initial commit of the events package
The docker/distribution/notifications package has been groomed for
general use. It now provides a tool for dispatching and routing of
events.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-03-22 22:24:51 -07:00
Andrea Luzzardi a713aa633d Initial commit 2016-03-22 21:23:50 -07:00