How to resolve consistently occuring 502 errors in Spring Reactive based microservice using Netty Server

I have Spring Reactive based microservice which is using Netty Server with version 4.1.101.Final.The complete architecture and flow of my microservice is:
API Gateway -> Load Balancer -> PCF (Go Router) -> Spring Reactive App.
I am consistently getting 502 errors saying Unexpected EOF on target and no other logs are printed apart from this. For investigating the issue, I performed performance tests using different configuration of load balancer and Api gateway, but I suspect Netty is creating the issue. I feel like Netty is sending a FIN to API gateway before 60 seconds and timeout is configured to 60 seconds in Api Gateway.

I was trying to figure out the by default connection timeout of netty and trying to set the connection-timeout to 60 seconds by adding it in application.yml using:

server:
   netty:
     connection-timeout: 60000

I have enabled the logs of reactor nettty and kept the logging level as DEBUG. But I cannot see any logs related to this which can ensure the connection timeout.
After I start my server and hit any request…then I see continuos logs saying New http connection, requesting read. Then It establishes a connection and when the request is served it immediately starts requesting for new connection. It does not look like there is any connection timeout or keep-alive timeout being configured.

I also tried to add keep-alive timeout for netty server by creating a Custom Netty Config.

public class NettyCustomConfig implements WebServerFactoryCustomizer<NettyReactiveWebServerFactory>{
@Override
public void customize(NettyReactiveWebServerFactory factory){
   factory.addServerCustomizers(httpServer->
      httpServer.tcpConfiguration(tcp->
         tcp.childOption(ChannelOption.SO_KEEPALIVE,true)
          .childOption(EpollChannelOption.TCP_KEEPINTVL,2)
          .childOption(EpollChannelOption.TCP_KEEPIDLE,2)
          .childOption(EpollChannelOption.TCP_KEEPCNT,2)
));
}
}

After this also, I cannot see any logs which can give any information about connection getting dropped or reused after keep-alive timeout.I also cannot see logs that show notification being sent after connection is idle and connection is dropped before a new one is created.

I want to capture the connection-timeout and keep-alive timeouts for the connections being used for processing the requests and catch the connections which are being dropped on being idle or timeout so that I can solve my 502 errors by configuring correct timeout values.

New contributor

Satyam Pareek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật