Files
seaweedFS/weed/command
Chris Lu 02f7d3f3e2 Fix S3 server panic when -s3.port.https equals -s3.port (#7794)
* Fix volume repeatedly toggling between crowded and uncrowded

Fixes #6712

The issue was that removeFromCrowded() was called in removeFromWritable(),
which is invoked whenever a volume temporarily becomes unwritable (due to
replica count fluctuations, heartbeat issues, or read-only state changes).

This caused unnecessary toggling:
1. Volume becomes temporarily unwritable → removeFromWritable() →
   removeFromCrowded() logs 'becomes uncrowded'
2. Volume becomes writable again
3. CollectDeadNodeAndFullVolumes() runs → setVolumeCrowded() logs
   'becomes crowded'

The fix:
- Remove removeFromCrowded() call from removeFromWritable()
- Only clear crowded status when volume is fully unregistered from
  the layout (when location.Length() == 0 in UnRegisterVolume)

This ensures transient state changes don't cause log spam and the
crowded status accurately reflects the volume's size relative to
the grow threshold.

* Refactor test to use subtests for better readability

Address review feedback: use t.Run subtests to make the test's intent
clearer by giving each verification step a descriptive name.

* Fix S3 server panic when -s3.port.https equals -s3.port

When starting the S3 server with -s3.port.https=8333 (same as default
-s3.port), the server would panic with nil pointer dereference because:

1. The HTTP listener was already bound to port 8333
2. NewIpAndLocalListeners for HTTPS failed but error was discarded
3. ServeTLS was called on nil listener causing panic

This fix:
- Adds early validation to prevent using same port for HTTP and HTTPS
- Properly handles the error from NewIpAndLocalListeners for HTTPS

Fixes #7792
2025-12-16 13:21:15 -08:00
..
2025-10-27 23:04:55 -07:00
2025-10-13 18:05:17 -07:00
2025-09-09 01:01:03 -07:00
2021-09-01 02:45:42 -07:00
2025-10-13 18:05:17 -07:00
2025-12-14 16:02:06 -08:00
2025-03-29 21:12:06 -07:00
2025-10-31 17:08:00 -07:00
2022-02-27 03:03:19 -08:00
2022-08-31 23:16:05 -07:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2019-11-28 18:44:27 -08:00
2025-07-02 18:03:17 -07:00
2024-07-16 09:15:55 -07:00
2025-10-13 18:05:17 -07:00
2025-03-29 21:12:06 -07:00
2025-06-03 22:50:45 -07:00
2025-06-26 11:09:17 -07:00
2025-06-03 22:46:10 -07:00