28 Commits

Author SHA1 Message Date
clayly
663737396c Fix range download: use real seek instead of read-and-discard (#3044)
* perf(rest): fix range download to use real seek

FileStreamingUtil.copyStreams called IOUtils.skipFully(from, start),
which reads start bytes through a 2KB scratch buffer. Combined with
ArtifactStream not overriding skip(long), a Range request at offset
600MB on an 800MB artifact made the server read+discard 600MB before
serving any payload. With 80 concurrent devices this saturated CPU.

Fix:
- ArtifactStream.skip(long) now delegates to the wrapped stream so a
  FileInputStream can lseek(2). Non-seekable backends (CipherInputStream
  for encrypted artifacts, S3 streams) keep their existing behaviour.
- FileStreamingUtil.copyStreams uses InputStream.skipNBytes(start)
  instead of IOUtils.skipFully so the call chain reaches the underlying
  skip().

JMH (single thread, 600MB offset, 1MB read): 27.21 ms -> 0.034 ms (800x).
Real stack (80 parallel curl, 1MB range at 600MB offset): avg 728 ms ->
28 ms (26x), p99 966 ms -> 54 ms.

Adds JMH test-scope dep and FileStreamingBenchmark/BufferSizeBenchmark
for regression detection. Both gated on -Dperf=true so default test
runs stay fast.

* perf(rest): drop JMH benchmarks per upstream review

Eclipse hawkBit minimizes dependencies. Drop jmh-core / jmh-generator-annprocess
test-scope deps (also GPL-2.0 — not EPL-2.0 compatible) and the two
JMH benchmarks added with the seek fix. Move the BUFFER_SIZE rationale
into an inline comment in FileStreamingUtil so the empirical reasoning
behind keeping the 8 KiB constant stays discoverable.

The benchmarks may be reintroduced as a separate PR if upstream wants a
perf-regression harness later.
2026-05-14 11:17:32 +03:00
Avgustin Marinov
1be473b22c [#2845] Bump Spring boot to 4.x (#2941)
Notes:
1. (!) Eclipselink shall be migrated to 5.0 (in 4.0.8 there are incompatible classes, e.g EJBQueryImpl doesn't implement some newer methods). In the moment is with beta (5.0.0-B12) - JUST for testing!
2. (!) Ethlo plugin doesn't work with Eclipselink 5.0, it builds with Eclipselink 4.0.8 (could be a problem)
3. Dependencies - new starters, test starters changes, some dependencies refactoring
4. Auto-configs split - package changes, some properties classes changes
5. Spring nullable org.springframework.lang.Nullable/NonNull are depecated and replaced with jspcify -> org.jspecify.annotations.Nullable/NonNull (NullMarked)
6. Lombok config - adding lombok.addNullAnnotations=jspecify - to do not mess annotations
7. Distributed lock table changes - SP_LOCK table db migration
8. Spring Retry replaced with Spring Core Retry - does repace retry in hawkbit
9. Specifications -> added Update/Delete(/Predicate) Specifications and JpaSpecificationExecutor changed
10. HawkbitBaseRepositoryFactoryBean modified to register properly
11. Jackson - 2 -> 3, package migrations, finals are not deserialized by default(enable finals deserialization, consider make non-final), too ‘smart’ tries to set complex objects instead of using non args constructor (-> @JsonIgnore), some other default configs made

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2026-04-14 11:31:41 +03:00
Avgustin Marinov
62c76311e5 Fix some compile warnings (#2919)
* Fix some compile warnings
* Some classes made final
* JPA entities made not serializable

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2026-02-11 14:05:46 +02:00
Avgustin Marinov
fb69372ed5 Remove commons-text dependency (#2817)
And thus fix vulnerability that it brings. Also decrease dependencies.

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-11-18 13:27:14 +02:00
Avgustin Marinov
1f71e01318 Implement JSON security context serializer (new default) - smaller info and human readable (#2652)
keeps backward compatibility by being able to fallback to JAVA_SERIALIZATION

+ fix DMF messages with status code

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-05 13:35:45 +03:00
Avgustin Marinov
2e97d67489 Small Artifact storage refactoring (#2648)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-03 17:05:59 +03:00
Avgustin Marinov
59cb320fcc Get rid of artifactRepository naming of ArtifactStorage (#2645)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-03 11:55:14 +03:00
Avgustin Marinov
2a636328a0 20250828 cleanup (#2639)
* Cleanup

* Refactor artifact management
2025-09-02 16:08:14 +03:00
Avgustin Marinov
b4edde8cc3 Refactor Management interfaces: find/get pattern (#2609)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-15 16:18:32 +03:00
Avgustin Marinov
7e8dd046e0 Rename autoconfig for filesystem package (#2541)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-10 12:09:56 +03:00
Avgustin Marinov
edd6dabb90 Move artifact encryption to hawkbit-artifact-api where it does belong (#2540)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-10 11:57:44 +03:00
Avgustin Marinov
8c6d56f177 Make some test timeouts (await) configurable (#2525)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-02 12:45:26 +03:00
Avgustin Marinov
ef25aa59f0 Fix new line after @Test (#2486)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-06-20 17:42:55 +03:00
Avgustin Marinov
cb7f1107fe Remove allure (phase2) (#2483)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-06-20 15:51:06 +03:00
Avgustin Marinov
a61e9cd6ae Sonar Fixes (#2233)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-01-24 15:41:06 +02:00
Avgustin Marinov
bb9c9bfad8 Remove some of the field injections (Sonar recomendtion) (#2218)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-01-23 09:52:29 +02:00
Avgustin Marinov
fe518fc4fa Fix temp dirs creation (#2209)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-01-21 11:38:48 +02:00
Avgustin Marinov
33a6250646 Sonar Fixes (4) (#2210)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-01-21 10:20:09 +02:00
Avgustin Marinov
e64053fb59 Improve creatTempFile/Dir usage (#2208)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-01-21 09:11:07 +02:00
Avgustin Marinov
5dabe9117a Fix SonarQube issues (2) (#2205)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-01-20 16:29:45 +02:00
Avgustin Marinov
be6a58a38a Added support for different version schemes depending on the provider (#2124)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-06 14:40:13 +02:00
Avgustin Marinov
0c2b7f398f Sonar fixes (#2114)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-03 08:50:31 +02:00
Avgustin Marinov
c3bcc4371d Code formating and removing unused imports (#2072)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-18 09:13:58 +02:00
Avgustin Marinov
ce846ebe81 Code refactoring of hawkbit-artifact (#2050)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-16 17:57:17 +02:00
Avgustin Marinov
7902b89268 Unify artifact names (#2021)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-12 15:09:03 +02:00
Avgustin Marinov
cf5b91cfd3 Fix ArtifactFilesystemConfiguration auto configuration (#2018)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-12 13:47:28 +02:00
Avgustin Marinov
42582229f1 Small adjustments (#2017)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-12 13:22:45 +02:00
Avgustin Marinov
32acb44e31 Artifact modules moved in new hawkbit-artifact parent (#2012)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-12 09:40:44 +02:00