fix(collector): allow ossutil state cache writes - #13
Conversation
📝 WalkthroughWalkthroughThe templated Binance LOB archiver systemd unit now declares ChangesService state configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deployment/aliyun/binance-lob-archiver`@.service:
- Line 11: Update the service’s environment mapping to set SPOOL_DIR under
${STATE_DIRECTORY}, replacing the hard-coded /data/monday/spool/binance-lob path
for the archiver and ossutil cache. Keep StateDirectory=hft-collector and ensure
both spot and usdm spool paths use the systemd-managed persistent state
directory.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dd666b28-afe3-4eb3-84f1-205df4b8cc74
📒 Files selected for processing (1)
deployment/aliyun/binance-lob-archiver@.service
| Type=simple | ||
| User=hftcollector | ||
| Group=hftcollector | ||
| StateDirectory=hft-collector |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
rg -n 'STATE_DIRECTORY|SPOOL_DIR|ossutil|cache|queue' deployment rust_hft \
--glob '!**/.git/**'
rg -n 'EnvironmentFile|Environment=' deployment/aliyun/binance-lob-archiver@.serviceRepository: proerror77/monday
Length of output: 50373
🏁 Script executed:
#!/bin/bash
set -eu
printf '\n## service\n'
cat -n deployment/aliyun/binance-lob-archiver@.service
printf '\n## env files in deployment/aliyun matching archiver\n'
fd -a 'binance-lob-archiver*.env' deployment/aliyun
printf '\n## spot env\n'
cat -n deployment/aliyun/binance-lob-archiver-spot.env
printf '\n## references to STATE_DIRECTORY in deployment/aliyun and rust_hft/tools/collector\n'
rg -n 'STATE_DIRECTORY|SPOOL_DIR|COLLECTOR_SPOOL_DIR|ossutil' deployment/aliyun rust_hft/tools/collector --glob '!**/.git/**'Repository: proerror77/monday
Length of output: 4367
🏁 Script executed:
#!/bin/bash
set -eu
printf '\n## service file\n'
cat -n deployment/aliyun/binance-lob-archiver@.service
printf '\n## archiver env files\n'
for f in deployment/aliyun/binance-lob-archiver*.env; do
echo "== $f =="
cat -n "$f"
done
printf '\n## archiver implementation references\n'
rg -n 'SPOOL_DIR|STATE_DIRECTORY|health\.json|queued|ossutil' deployment/aliyun rust_hft/tools/collector --glob '!**/.git/**' | head -n 120Repository: proerror77/monday
Length of output: 5292
Wire SPOOL_DIR to ${STATE_DIRECTORY} in the env mapping.
StateDirectory=hft-collector only creates /var/lib/hft-collector; the service still loads SPOOL_DIR=/data/monday/spool/binance-lob/{spot,usdm} from the env files, so the systemd state dir remains unused. Map the archiver/ossutil state path through ${STATE_DIRECTORY} if this setting is meant to provide the persistent cache.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deployment/aliyun/binance-lob-archiver`@.service at line 11, Update the
service’s environment mapping to set SPOOL_DIR under ${STATE_DIRECTORY},
replacing the hard-coded /data/monday/spool/binance-lob path for the archiver
and ossutil cache. Keep StateDirectory=hft-collector and ensure both spot and
usdm spool paths use the systemd-managed persistent state directory.
Summary
/var/lib/hft-collectoras the collector state directoryProtectSystem=strictand the existing spool-only write allowanceVerification
systemd-analyze verifypassed onmonday-trade-data-1_SUCCESSthrough hour 11Summary by CodeRabbit