nodejs / docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:
https://hub.docker.com/_/node/
MIT License
8.23k stars 1.97k forks source link

# Bug Report: Encoding Version Changes on Server Overload #2135

Closed allglenn closed 2 weeks ago

allglenn commented 2 weeks ago

Description

We are running an Express API within a Docker container, serving both iOS and Android applications as clients. We've observed that under a high load of requests, the server automatically changes its encoding settings, leading to the appearance of unexpected characters on the server side. This encoding issue has caused our iOS mobile application to crash.

Environment

Current Behavior

When the server experiences a high load, it automatically switches its encoding, resulting in malformed characters. This issue has led to instability and crashes in the iOS client application. Screenshot 2024-08-26 at 22 26 27

Expected Behavior

The server should maintain consistent encoding settings regardless of the load, ensuring stable and correct data transmission to the client applications.

Steps to Reproduce

  1. Run the API in a Docker container using the 22.7.0-alpine image.
  2. Simulate a high load of requests from both iOS and Android clients.
  3. Observe the encoding changes and resulting errors on the server.

Temporary Fix

We temporarily reverted to an LTS Alpine version of the Docker image, which resolved the issue and stabilized the encoding.

Possible Solution

A permanent solution may involve ensuring that the server's encoding settings are locked or managed more robustly to prevent automatic changes under load. It could also be beneficial to investigate whether specific configurations in the 22.7.0-alpine image are contributing to this behavior.

Additional Information

Further investigation is needed to pinpoint the exact cause of the encoding switch and to develop a more robust solution that can handle high loads without affecting the server's stability or the integrity of data sent to clients.

Nicd commented 2 weeks ago

From an outsider's perspective, looks related to https://github.com/nodejs/node/issues/54543

nschonni commented 2 weeks ago

Thanks @Nicd ! Closing as this is an upstream issue. Nothing in this repo can address that issue