Commit Graph

38 Commits

Author SHA1 Message Date
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
783795eacd Wait for copier finishing it's work before closing logger
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: b6a42673abb8c2df5920343b9144a4ce422b2d50
Component: engine
2015-03-18 13:48:01 -07:00
0f5871ff56 Default 'json-file' logging driver and none logging driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 47a6afb93f7f71c7ef7dc692c0f50ac81b5a8c98
Component: engine
2015-03-13 12:13:21 -07:00
e70ef80162 correct some daemon spelling mistakes
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: 906974b185b431a8c493479f748677f3c0bc4ca3
Component: engine
2015-03-13 05:14:56 -04:00
bdb65abebf Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 7a9c944b827dc0cd416d701fe6460264f05166bb
Component: engine
2015-02-23 18:43:10 +00:00
2a8e65c2bf Remove explicit setting of ExitCode
That will be set in defer anyway. Also there was race between setting
ExitCode and inspect.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: e7f6433109fad4762379aed88ae70da36805f198
Component: engine
2015-01-29 14:50:42 -08:00
4db0e2e1ec restart: Fix the compare of restart policy
Since the failure count of container will increase by 1 every time it
exits successfully, the compare in function shouldRestart() will stop
container to restart by the last time.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: e721ed9b5319e8e7c1daf87c34690f8a4e62c9e3
Component: engine
2015-01-13 13:05:30 +08:00
ee8de7da26 restart: Fix an error about arguments missing
Function shouldRestart() checks the restart policy and records the
debug info and there should be two arguments in the log.Debugf().

Prior to the this patch, the logs were something like this:
- client: $ docker run --restart=on-failure:3 ubuntu /bin/sh -c 'exit 1'
- daemon: INFO[0168] ...
	  DEBU[0168] stopping restart of container %!s(int=3) because maximum
	  failure could of %!d(MISSING) has been reached
	  INFO[0086] ...

Btw, fix a spelling error in the same file:
- cotnainer -> container

----------------------------------------

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: af053ccf6b3179978e087defd0062664152697ef
Component: engine
2015-01-06 12:25:39 +08:00
ab25e4ba52 Add "OOM killed" event based on OOM state information
Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 44cab4a4ff05cb1e499fba19394aadb20fc887b8
Component: engine
2014-12-23 18:22:31 -05:00
b1aa2c30f8 Address comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 46f29449777b9fb67a02e13fe0f12fc10c99ab4b
Component: engine
2014-11-08 00:14:08 +00:00
77c86e509b This patch adds ability in docker to detect out of memory conditions in containers.
Since the containers can handle the out of memory kernel kills gracefully, docker
will only provide out of memory information as an additional metadata as part of
container status.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: f96e04ffc7973e290653044cc86dbc1efb18276d
Component: engine
2014-11-08 00:14:08 +00:00
811492e0cb See #8379 - if the container doesn't start I added code to make sure that if no other processing sets the container.exitCode to a non-zero value when we make sure its done before we return. I also made sure that while trying to start the CMD/ENTRYPOINT, if it fails, then we set the container.exitCode to the exitStatus from the exec().
Closes #8379

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 69a5b827dcf01a6de5949a161606058017014cdc
Component: engine
2014-11-05 18:23:42 -08:00
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
cc7745c80d Fix typo:betweem->between and PtySlace->PtySlave
Signed-off-by: Arika Chen <eaglesora@gmail.com>
Upstream-commit: bfc9d8bbea2f41247fa543034bbbf64704ae3aae
Component: engine
2014-09-30 07:22:09 -04:00
13e3017817 Use State as embedded to Container
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: e0339d4b88989a31b72be02582eee72433d2f0ec
Component: engine
2014-09-03 00:01:11 +04:00
559392405c Rename 'StdConfig' to 'StreamConfig'.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 3a7e07355a1ad67f71ee4255e06526186fd48f7a
Component: engine
2014-09-01 14:31:01 -07:00
a7e2cb4124 Refactoring execdriver.Command and Container structs to support 'docker exec' and other
similar features in the future.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 4aa5da278f49c889d43191f82ff42d3a95266d62
Component: engine
2014-09-01 14:30:16 -07:00
76ca127323 Merge Container and State mutexes
Resolved all deadlocks and fixed race between kill and
monitor.resetContainer
Fixes #7600

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 517ba44e3742c39c4c3fc249b8c40e9b7ddd845f
Component: engine
2014-08-29 12:56:04 +04:00
62eb5165d1 Fix race condition between cleanup and Start
There was problem when Start might be before cleanup

Fixes #6904

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 12ff89a3901cd2debf13e7ccc3a1a780380e4dd9
Component: engine
2014-08-26 20:57:12 +04:00
0b9e4ed61e Cleanup: Make channels unbuffered
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 0d4d7e4a2851c60f768f71a79a78c068fd9dffe8
Component: engine
2014-08-14 21:51:25 +04:00
1b8bad68b3 Fix race between container cleanup and inspect/ps
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 93d6adf8a19855edf118d27d0239222f572d8292
Component: engine
2014-08-14 21:51:06 +04:00
f4db7d15dc Fix race condition in sending started signal from monitor
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 1480168e9f6178e4015aa4dcc035a6963c59f431
Component: engine
2014-08-14 21:50:56 +04:00
9df494bb71 another commit to do like @crosbymichael
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: a0392324f194f4f92e3205f0c0ed8b71dc2fc93f
Component: engine
2014-08-14 01:36:26 +00:00
9b55fc0736 Deprecate --restart on the daemon
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 25c519e829640ebb23061b82c6ace88c5983b63d
Component: engine
2014-08-13 16:08:50 -07:00
db45de23ad Update based on comments from the code review
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 73ced636800c150640e2f0d307842b0f9259b611
Component: engine
2014-08-13 15:58:55 -07:00
02f3d4abed Rebased changes to return on first start's error
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 2ec1b697c1a7c0ecc534b9ebffd7ba40ea285ff7
Component: engine
2014-08-13 15:58:55 -07:00
10b2364f13 Reguardless of success reset time increment
Reset the time increment if the container's execution time is greater
than 10s or else as a container runs and is restarted the time will grow
overtime.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: ebf5d4657d14c7b57a5ca1c7b8689077b18b33dc
Component: engine
2014-08-13 15:58:54 -07:00
9726fa5fb8 Improve wait during restart
We need to do this so that when a user asks docker to stop the container
and it is currently in the restart loop we don't want to have to wait
for the duration of the restart time increment before ack. the stop.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 972c89493148f930388097816663d453bf3e8c2c
Component: engine
2014-08-13 15:58:54 -07:00
5ac7ecfbf7 Honor the restarting state in Stop
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: c4a00d549d0b895bb990491cbdf58aabe2891842
Component: engine
2014-08-13 15:58:54 -07:00
73d4ecfe93 Add Restarting state when docker is handling the restart of containers
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: a2afb2b1e37e72cab0d68cfe8dd0ec830b7a54e5
Component: engine
2014-08-13 15:58:54 -07:00
6ce3708a40 Add additional comments for vague lines
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: be22d7ac2db6396becd63ec2dd28b9731011c9b9
Component: engine
2014-08-13 15:58:54 -07:00
1f88a5f013 Move container start event into monitor
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 6ae05936e1f343a2ecc51b8f642bdc8b93325d81
Component: engine
2014-08-13 15:58:54 -07:00
4dadb32ece Fix rebase around log event
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: b7550cd456e29874279499a546b07bb062a12096
Component: engine
2014-08-13 15:58:54 -07:00
91b1d9394b Only restart containers on daemon load with policy of always
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 41870a42bee9c394c61aba4bd81f782dbd38da12
Component: engine
2014-08-13 15:58:54 -07:00
ed9f19284d Add documentation and update restart rules.
Implement time backed backoff for restarting and fix failure count when
the maximum is 0

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 860c13b788944410a98a6ad5b5cfb74de0a8405b
Component: engine
2014-08-13 15:57:37 -07:00
b614c77a54 Refactor container monitor into type
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 2b0776c883c41cda0b86808fe86e4df6e1aa1cd5
Component: engine
2014-08-13 15:56:53 -07:00