| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix chef-solo spec timeouts
caused by a race condition (not actually fixed) where the pid
can be read by the process which lost the race to lock it before the
pid has been written by the process which got the lock.
the result is a message like:
"WARN: Chef client is running, will wait for it to finish and then run."
without any numerical pid.
i'm not super concerned with fixing the race, this will unbreak a lot
of red travis failures though.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* revert some debugging
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
(This was always intended to be the case, and it's difficult
to do it yourself. We have been teaching people whyrun-safe
methods to make resources right alongside Custom Resources, as well.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
there's a WONTFIX closed bug in ruby-lang.org on this bug:
https://bugs.ruby-lang.org/issues/10583
they seem to be favoring speed over accuracy with the result
that if you're doing I/O synchronization (like our run_lock?)
inside of a Process.spawn chain like this that you have to
wrap the spawn calls inside of threads.
probably a best practice to wrap every spawn call with a
Thread.
this probably also explains why we had the silly-long 20
second timeout?
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- fix the 'last' statements (my perl brain occassionally crops up
in ruby code) and replace with a raise. of course this just swaps
one exception for another, but this time its really intended to
work this way.
- swap the order of the expecations so that if we fails to see the
waiting on the other process statement, but we blow up in both
threads in the exception that was just added, we know we actually
have a legit run_lock race condition that this code just found.
does not fix this bug, just gets us a bit more information if it
reoccurs.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Wait for the start callback rather than the do block, as it happens
later. This prevents us from getting into many conditions where the
start returns before the server is fully initialized, where if stop()
is called too soon after start returns, it would cause exceptions.
2. Wait for the thread to finish completely
3. Use Thread.current.abort_on_exception` to show the actual listen errors,
so that problems like this can be diagnosed.
4. Use :each to start and stop TinyServer so that race conditions like this
are exposed earlier and more often (this will let us rid ourselves of them
more quickly).
5. Use WEBrick::HTTPServer directly, which gets rid of the need for the
complicated trap workaround (rack is the one that traps).
|
|\
| |
| | |
speed up solo test
|
| |
| |
| |
| |
| |
| | |
when running on my mac this entirely removes all the sleeps
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
removes the requirement that the second wait for the first, just that
one of them waits for the other, so if we ever somehow lose that race
and the second wins the run_lock as long as the first sleeps then its
all good...
drops all the sleeps down a lot, thinking about how to make this more
cleverer so that it doesn't sleep but handshakes properly so that we
don't need 25 seconds of sleep on slowaris tests..
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|/
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|\
| |
| | |
Don't use relative_path_from on glob results
|
| |
| |
| |
| | |
Windows Ruby 2.3 translates pathnames like ADMINI~1 to Administrator, making the comparison fail.
|
|/ |
|
|
|
|
|
|
| |
its always red on my mac
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* exit code functional specs
* audit exit codes
* reboot now/reboot failed/reboot pending exit codes
* Deal with forked and unforked process and get the right exit code
* Reboot Now should really be reboot scheduled
* pass exception rather than exit code
* updated with sigint and sigterm
* support legacy fatal!("", 2) behavior
* fixup all fatal! and exit! calls
|
|
|
|
|
|
| |
ie, only when we're in OG mode and not in local mode.
Signed-off-by: Thom May <thom@chef.io>
|
| |
|
|
|
|
|
|
|
|
| |
This allows us to use the path we produce for other display purposes and
consume it internally to have a canonical path for comparisons and
printing
Signed-off-by: Thom May <thom@may.lt>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This allows one to have a resource which is really only appropriate for
one platform, but available everywhere. Then you simply allow noop to
provide the resource everywhere besides where it's supposed to be.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is similar to poise's approach but has a few differences.
Similarly to poise, the base behavior of notifications and find() and
lookup() on the resource collection is changed to be 'recursive' and
to search in outer contexts for resources and will return them by
default.
There are find_local() and lookup_local() methods added to allow for
bypassing the recursion and making sure to throw exceptions if the
current run_context does not have any matching resources.
The CHEF-3694 resource cloning code has been modified to call the
lookup_local() API and not to be recursive because we believe that
nobody in their right mind would want that behavior (and resource
cloning should eventually be removed). So the behavior of resource
cloning should remain unchanged.
The behavior of delayed notifications to resources outside of the current
run_context is slightly different than what Poise has been implementing.
The delayed notification will run in the run_context of the resource
that is being notified. I think Poise tends to bubble up to the nextmost
wrapping resource context (as opposed to Poise's subcontext_block or
notifying_block contexts). This code I think is conceptually simpler to
reason about, and I think it gets the use case right where if you're
notifying a service resource in the outermost run_context from within
multiple wrapping resources that it correctly bubbles out to the
outermost run context and will notify with all the other delayed
notifications at the end of the chef client run.
Another useful feature of the delayed notification behavior is that if
we do implement notifying_block or subcontext_block that each block can
get its own delayed notification run and any resources that are inside
of that block can run in the delayed notification phase of that block
(while still being able to notify resources outside of the block and
having those delayed notifications run in the receiving resources
run_context). This will let us implement an often-requested feature for
having "notifications delayed to the end of a block/recipe" instead of
having to do all notifications absolutely immediately or delayed to the
end of the chef run.
This code also cleans up the object model a little bit. All of the
state about notification collection is now hanging off of the
run_context -- the delayed_actions have been moved from the Chef::Runner
to the Chef::RunContext. Hanging it off of the Chef::Runner would have
been very difficult to 'target' from other run_context's without adding
a pointer back from the RunContext to the Runner and that feels like the
wrong object model. The RunContext is now responsible for all of its
notification state, while the Runner is responsible for wiring up
the notifications across different run_contexts.
Note that it will not be possible to send a notification to a
run_context which has already been converged. That seems to make sense
to me and the search API on the resource collection does not support
returning resources from run_contexts that are children, only parents
(and we don't actually hold onto pointers to child run_contexts and
they may be garbage collected).
|
|\
| |
| | |
Improve wording in Knife
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Support libraries with sub directories
|
| | | |
|
| |/
|/|
| |
| | |
'nil_set' parameter to get() to skip a spurious warning when that happens.
|
|\ \
| | |
| | | |
better chef+ruby rspec constraints
|
| |/
| |
| |
| |
| |
| |
| |
| | |
lets us use Gem::Dependency constraints directly as rspec
constraints for matching Chef::Version and RUBY_VERSION.
copies some magic sauce from bundler that does something
similar
|
|\ \
| |/
|/| |
RFC-060 gem metadata MVP
|
| |
| |
| |
| |
| | |
also add back a bunch of other ruby env vars so that our ruby
environment remains sane.
|
| |
| |
| |
| | |
no enforced trailing comma on arguments...
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
252 Style/TrailingCommaInLiteral
84 Style/TrailingCommaInArguments
15 Style/SpaceAroundKeyword
--
351 Total
We already dealt with SpaceAroundKeyword under its old name
SpaceBeforeModifierKeyword, it looks like it got stricter about
spaces after keywords.
TrailingComma also got split, and it looks like the
TrailingCommaInArguments behavior is new?
|
| | |
|
|/
|
|
|
|
|
|
|
| |
Style/NegatedWhile
Style/ParenthesesAroundCondition
Style/WhileUntilDo
Style/WordArray
Performance/ReverseEach
Style/ColonMethodCall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
4174 Style/SpaceInsideHashLiteralBraces
1860 Style/SpaceAroundOperators
1336 Style/SpaceInsideBlockBraces
1292 Style/AlignHash
997 Style/SpaceAfterComma
860 Style/SpaceAroundEqualsInParameterDefault
310 Style/EmptyLines
294 Style/IndentationConsistency
267 Style/TrailingWhitespace
238 Style/ExtraSpacing
212 Style/SpaceBeforeBlockBraces
166 Style/MultilineOperationIndentation
144 Style/TrailingBlankLines
120 Style/EmptyLineBetweenDefs
101 Style/IndentationWidth
82 Style/SpaceAroundBlockParameters
40 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
|
|
|
| |
Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
|
| |
|
| |
|
|
|
|
|
|
| |
1. Warn when default values are invalid.
2. Never validate nil (on set or get) if there is no default.
3. Emit "will be invalid in Chef 13" warning when setting an invalid nil value.
|
| |
|
| |
|
| |
|
|
|
|
| |
unless using properties on the resource
|