운영 중인 서버에서 ConcurrentModificationException 가 발생하여 원인 파악을 시작하였다. 예외가 발생한 코드 재현 Map reduce = IntStream.range(0, 100) .parallel() .mapToObj((num) -> { Map map = new HashMap(); map.put(num, num); return map; }) .reduce(new HashMap(), (a, b) -> { a.putAll(b); return a; }); 에러가 발생한 로직을 간단하게 요약하면 위와 같이 정리가 되는데 운영 코드에서는 mapToObj 부분에서 I/O 를 실행하고 있다. I/O 를 Parallel 하게 실행하기 위하여 Stream 의 Parallel 을 사용하고 있다...
ExecutorService executorService = Executors.newFixedThreadPool(3); Stream.of(3, 2, 1) .map((i) -> CompletableFuture.supplyAsync(() -> { try { System.out.println(Thread.currentThread().getName() + " : start"); Thread.sleep(i * 1000L); System.out.println(Thread.currentThread().getName() + " : end"); } catch (InterruptedException e) { throw new RuntimeException(e); } return i; }, executorService)) ..
- Total
- Today
- Yesterday
- custom config data convertion
- Lazy
- ResultSet
- GlobalFilter
- getBoolean
- router
- mariada-connector
- dynamodb
- Flux
- circurit breaker
- reactor
- MariaDB
- DyanomoDB
- wait()
- notifyAll()
- RouteDefinition
- referencedColumnName
- AbstractMethodError
- notify()
- RoutePredication
- HashMap
- Seperate Chaining
- mariadb-connector-j
- aurora
- spring cloud gateway
- N+1
- ConcurrentHashMap
- reative
- msyql-connector-java
- rate limit
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |