apache / apache/incubator-seata
seata不能和es共存
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
seata不能和es共存,启动会报错误
springboot启动时报下面这个错误,
Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [12], rejecting [12]
debug跟踪发现
io.netty.util.NettyRuntime.setAvailableProcessors方法 设置availableProcessors=12,(应该是seata占用了netty)
如果在启动类里添加
System.setProperty("es.set.netty.runtime.available.processors", "false");
关闭掉设置availableProcessors,可以正常启动,但是es的ElasticsearchRepository无法注入。
Contributor guide
Research direction
Reproduce the Spring Boot startup failure with Seata and Elasticsearch, then inspect NettyRuntime.setAvailableProcessors and the ElasticsearchRepository injection path. Check how the startup class and the es.set.netty.runtime.available.processors workaround affect initialization; done means the application starts and ElasticsearchRepository can be injected without that workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elasticsearch, java, spring-boot
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100