Commit Graph

1144 Commits (01f73d257fa903dce10fd35cf196dd0c1ba7745e)

Author SHA1 Message Date
Phillip Webb 496b3a8d75 Relocate FileWriters to `spring-boot`
Move ApplicationPidFileWriter and EmbeddedServerPortFileWriter to the
core spring-boot project since they're not really tied to the actuator.

Fixes gh-6398
8 years ago
Johnny Lim 68fe8a58b8 Align message with regex for AbstractMvcEndpoint.path
Closes gh-6437
8 years ago
Andy Wilkinson fe22609096 Test that temp file has been deleted before triggering heap dump
The MBean requires that a file does not exist at the location to which
it’s dumping the heap. This commit updates the test to ensure that the
temporary file that’s created to get a location for the heap dump file
is deleted before asking the MBean to dump the heap to that location.
8 years ago
Phillip Webb 05cde789e1 Reduce noise in /end actuator docs
Update the `/env` sample used in the actuator docs to use only a limited
set of keys.

Fixes gh-5849
8 years ago
Phillip Webb 05ff4ed4e0 Upgrade to Tomcat 8.5.4 & remove tomcat-juli
Upgrade the managed Tomcat dependency to 8.5.4 and remove `tomcat-juli`
since it's now included in `tomcat-embed-core`.

Fixes gh-6192
8 years ago
Phillip Webb e03e109874 Polish 8 years ago
Stephane Nicoll 7e6f4021de Polish contribution
Closes gh-6059
8 years ago
RichardCSantana 42bb843364 Fix Bug HealthIndicator for Redis Cluster
See gh-6059
8 years ago
Andy Wilkinson 91df749839 Improve usage of ConcurrentMap
- Call get rather than containsKey then get
- Only call putIfAbsent after get has returned null to avoid unnecessary
  object creation

Closes gh-6382
8 years ago
Adrian Cole 38e3b39d3b Improves metrics performance by not guarding map.get
ConcurrentHashMap implements `containsKey` with `get`. By removing a
redundant call to `containsKey`, we guarantee better performance in our
counter services.

The geek inside measured this with JMH, and found under 4 threads of
contention, throughput on this check was 40% higher in success case.

Benchmark                                  Mode  Cnt     Score     Error   Units
TestBenchmarks.containsKeyAndGet_success  thrpt   30   432.389 ±  20.616  ops/us
TestBenchmarks.get_success                thrpt   30   606.789 ±  10.848  ops/us

Closes gh-6379
8 years ago
Johnny Lim a9f6ae4422 Polish
Closes gh-6374
8 years ago
Andy Wilkinson 8e669e2eef Merge branch '1.3.x 8 years ago
Andy Wilkinson 4963cfd67b Reset thread's interrupted flag when catching InterruptedException
Closes gh-6360
8 years ago
Andy Wilkinson e53d3167ab Set TCCL of shutdown thread when triggered by the shutdown endpoint
Previously, the shutdown endpoint would spawn a new thread to perform
the shutdown but did not explicitly configure its thread context
class loader (TCCL). This mean that the new thread would use the
request thread's TCCL as its TCCL. This meant that a different TCCL
would be used compared to a shutdown triggered by the shutdown hook
and also caused problems with Tomcat's thread leak detection logic.

This commit updates the shutdown endpoint to explicitly configure the
TCCL of the shutdown thread to be the ClassLoader that loaded the
endpoint's class.

Closes gh-6361
8 years ago
Andy Wilkinson c974de0119 Merge branch '1.3.x 8 years ago
Andy Wilkinson 5f751fe356 Set TCCL of shutdown thread when triggered by the shutdown endpoint
Previously, the shutdown endpoint would spawn a new thread to perform
the shutdown but did not explicitly configure its thread context
class loader (TCCL). This mean that the new thread would use the
request thread's TCCL as its TCCL. This meant that a different TCCL
would be used compared to a shutdown triggered by the shutdown hook
and also caused problems with Tomcat's thread leak detection logic.

This commit updates the shutdown endpoint to explicitly configure the
TCCL of the shutdown thread to be the ClassLoader that loaded the
endpoint's class.

Closes gh-6361
8 years ago
Phillip Webb bd65045285 Allow WebRequestTraceFilter header post processing
Update WebRequestTraceFilter so that additional post processing can be
applied to traced request headers. The postProcessRequestHeaders method
can be used to remove or change map entries before they are returned.

Fixes gh-6309
8 years ago
Andy Wilkinson 5bfc6a50fd Remove accidental usage of Type.getTypeName() which is a Java 8 API
Closes gh-6325
8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Lari Hotari 9f07e94450 Add MVC actuator endpoint for heap dumps
Add MVC only endpoint to obtain GZip compressed heap dump files.

See gh-5670
9 years ago
Lari Hotari e1893f66ce Extract AbstractMvcEndpoint class
Extract common functionality from Spring MVC only endpoints.

See gh-5670
9 years ago
Phillip Webb b732aeb453 Polish 9 years ago
Andy Wilkinson 5c6537c234 Consistently synchronize on this.monitor in InMemoryAuditEventRepository
See gh-6261
9 years ago
Andy Wilkinson 92bb24e365 Avoid synchronizing on this and use an internal monitor instead
Where possible, code that previously synchronized on this (or on the
class in the case of static methods) has been updated to use an
internal monitor object instead. This allows the locking model that's
employed to be an implementation detail rather than part of the
class's API.

Classes that override a synchronized method continue to declare
the overriding method as synchronized. This ensures that locking
is consistent across the superclass and its subclass.

Closes gh-6262
9 years ago
Phillip Webb 516df88ea0 Revisit AuditEventRepository interface
Update AuditEventRepository to restore support for `null` arguments and
explicitly Javadoc their meaning.

See gh-5854
9 years ago
Stephane Nicoll 3ba2b24301 Polish "Improve AuditEventRepository"
Closes gh-5854
9 years ago
Vedran Pavic 5f19323fbd Improve AuditEventRepository
See gh-5854
9 years ago
Phillip Webb 266445aaf0 Polish 9 years ago
Johnny Lim 5bc9d5b380 Polish
Closes gh-6244
9 years ago
Stephane Nicoll 84b2ff5c38 Polish "Add ability to filter cookies in trace data"
Closes gh-6018
9 years ago
Venil Noronha fde5e1b6a5 Add ability to filter cookies in trace data
See gh-6018
9 years ago
Andy Wilkinson 618535f576 Polish “Allow management server SSL to be configured independently”
This commit polishes b0fbc7e, throwing an exception when an attempt is
made to configure management-specific SSL without also configuring a
custom management port. The testing of management-specific SSL
configuration has also been improved.

See gh-6057
Closes gh-4810
9 years ago
Alex Antonov 3546ae399e Allow management server SSL to be configured independently
Closes gh-6057
9 years ago
Phillip Webb 15670b8e28 Relocate Neo4J auto-configuration
Move Neo4J auto-configuration from `autoconfigure.neo4j` to
`autoconfigure.data.neo4j` since it's intrinsically linked to Spring
Data.

See gh-5458
See gh-6142
9 years ago
Stephane Nicoll fda2505be6 Fix checkstyle violations 9 years ago
Stephane Nicoll 2dc6e5b6fa Refactor Jest auto-configuration package space
This commit moves the Jest auto-configuration from `spring.jest` to
`spring.elasticsearch.jest`

Closes gh-6032
9 years ago
Andy Wilkinson e5827f4840 Merge branch '1.3.x' 9 years ago
Andy Wilkinson 6c8f8c9d82 Better diagnotics when ESCF subclass breaks with custom management port
When a custom management.port is used, the child context is configured
with an EmbeddedServletContainerFactory bean that has the same class
as the parent context’s EmbeddedServletContainerFactory bean. This
ensures that the child context uses the same type of embedded container
as its parent when there are multiple embedded containers on the
classpath. It also causes a failure when the custom
EmbeddedServletContainerFactory subclass cannot be instantiated, for
example because it’s an anonymous inner-class.

This commit improves the diagnostics so that we fail fast with an
information exception message when we detect that the embedded servlet
container factory bean’s class cannot be instantiated.

Closes gh-6193
9 years ago
Phillip Webb 7446235ff4 Polish 9 years ago
Phillip Webb c136054e69 Merge branch '1.3.x' 9 years ago
Phillip Webb 5b97981c87 Polish 9 years ago
Andy Wilkinson f28e3d54c5 Upgrade to Tomcat 8.5.3
This commit changes the default version of Tomcat to 8.5.3 while
also retaining support for Tomcat 8.0 and 7.0. The main difference
in 8.5 is that the ServerSocketFactory abstraction that allowed the
TrustStore and KeyStore to be configured programatically no longer
exists. This logic has been replaced with the use of a custom URL
protocol (springbootssl) that provides access to the key store and
trust store of an SslStoreProvider. In addition to working with 8.5,
this approach has the advantage of also working with 8.0 and 7.0.

Closes gh-6164
9 years ago
Stephane Nicoll 06b81cf16f Use `@AliasFor` when applicable
This commit adds `@AliasFor` meta-data to annotations that declare an
alias attribute.

`@ConditionalOnProperty` and `@AutoconfigureRestDocs` were not migrated
due to the use of `AnnotationMetadata#getAnnotationAttributes`.

Closes gh-5187
9 years ago
Andy Wilkinson 971913e672 Polish 9 years ago
Stephane Nicoll 3799496dc8 Merge branch '1.3.x' 9 years ago
Stephane Nicoll 9abca48a7f Fix HAL browser entry point with contextPath
Previously, if the `contextPath` of the application wasn't the root, the
HAL browser could not initialize since the `entryPoint` was referring to
an invalid location.

This commit makes sure to take the `contextPath` into account.

Closes gh-5814
9 years ago
Andy Wilkinson fa0a137cd2 Merge branch '1.3.x' 9 years ago
Andy Wilkinson a2446080bc Prevent GC pressure from causing an NPE in SimpleInMemoryRepository
Previously, SimpleInMemoryRepository used a ConcurrentReferenceHashMap
to store its locks. The type of map will discard its entries when the
JVM comes under GC pressure. With the code in its previous form, this
could lead to a NullPointerException when the following occurred:

1. putIfAbsent returned null indicating that a new entry has been added
   to the map
2. GC pressure caused the map to discard the new entry
3. get returned null as the entry has been discard

There are two problems with the existing code:

1. Its usage of a ConcurrentMap is incorrect. The correct usage is:
   a. Call get to see if the map already contains a lock
   b. If the lock is null, create a new one
   c. Call putIfAbsent to add the new lock
   d. If the return value is non-null, another thread has created the
      lock and it should be used. If the return value is null, use the
      new lock created in b.
2. Once the use of ConcurrentMap has been corrected, the fact that it is
   a ConcurrentReferenceHashMap means that different threads could
   access the same value using different locks. This would occur if one
   thread has retrieved a lock from the map and is using it, while GC
   causes the lock to be removed from the map. Another thread then
   attempts to get the lock and, as GC pressure has remove it, a new
   lock is created allowing concurrent access to the same value.

This commit updates the code to use the ConcurrentMap correctly and also
replaces the ConcurrentReferenceHashMap with a ConcurrentHashMap. This
means that the repository will now use slightly more memory but this is
outweighed by the benefits of thread-safe updates and no risk of an NPE.

Closes gh-6115
9 years ago
Stephane Nicoll 64bbefd3ac Add Jest-based health indicator
This commit adds a Jest-based health indicator for ElasticSearch. If both
Jest and the Spring Data are available, the latter takes precedence as it
provides more information.

Closes gh-3178
9 years ago
Phillip Webb ee319a6d8b Merge branch '1.3.x' 9 years ago