release: v1.3.1 - Pipeline Queue Integration, OCR Fix, Worker Compatibility
Major Changes: - Pipeline Queue integration completed (internal.file + pipeline.commands) - Fixed old job_worker database compatibility with new command_queue table - Compiled Swift OCR binary (was missing, causing empty OCR results) - Added deep scan functionality through re-scan API Fixes: - Changed CommandJob.id from i32 to i64 for database compatibility - Added UUID generation in create_command (message_id field) - Fixed claim_pending_commands to query queue_name = 'internal.file' - Fixed field mappings: command_id → message_id, job_type → command_type - Added support for 'processing' status in CommandJobStatus Queue System: - internal.file queue: for register/unregister/re-scan commands (job_worker) - pipeline.commands queue: for vectorize/store_asrx/etc commands (pipeline_worker) Documentation: - Added comprehensive queue system documentation - Created M4 workspace status reports - Updated AGENTS.md with queue system details
This commit is contained in:
+43
-19
@@ -23,44 +23,68 @@ struct ProcessorCleanupGuard {
|
||||
impl Drop for ProcessorCleanupGuard {
|
||||
fn drop(&mut self) {
|
||||
use tokio::sync::TryLockError;
|
||||
|
||||
|
||||
// Release running map
|
||||
match self.running.try_write() {
|
||||
Ok(mut guard) => { guard.remove(&self.job_id); }
|
||||
Err(_) => error!("[ProcessorCleanupGuard] Failed to acquire running lock for job {} - resource may leak", self.job_id),
|
||||
}
|
||||
|
||||
|
||||
// Release running count
|
||||
match self.running_count.try_write() {
|
||||
Ok(mut guard) => { if *guard > 0 { *guard -= 1; } }
|
||||
Err(_) => error!("[ProcessorCleanupGuard] Failed to release running_count for job {}", self.job_id),
|
||||
Ok(mut guard) => {
|
||||
if *guard > 0 {
|
||||
*guard -= 1;
|
||||
}
|
||||
}
|
||||
Err(_) => error!(
|
||||
"[ProcessorCleanupGuard] Failed to release running_count for job {}",
|
||||
self.job_id
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
// Release per-job count
|
||||
match self.running_per_job.try_write() {
|
||||
Ok(mut guard) => {
|
||||
if let Some(c) = guard.get_mut(&self.job_id) {
|
||||
if *c > 0 { *c -= 1; }
|
||||
if *c == 0 { guard.remove(&self.job_id); }
|
||||
if *c > 0 {
|
||||
*c -= 1;
|
||||
}
|
||||
if *c == 0 {
|
||||
guard.remove(&self.job_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(_) => error!("[ProcessorCleanupGuard] Failed to release running_per_job for job {}", self.job_id),
|
||||
Err(_) => error!(
|
||||
"[ProcessorCleanupGuard] Failed to release running_per_job for job {}",
|
||||
self.job_id
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
// Release pipeline-specific slot
|
||||
match self.pipeline {
|
||||
PipelineType::Frame => {
|
||||
match self.frame_count.try_write() {
|
||||
Ok(mut guard) => { if *guard > 0 { *guard -= 1; } }
|
||||
Err(_) => error!("[ProcessorCleanupGuard] Failed to release frame slot for job {}", self.job_id),
|
||||
PipelineType::Frame => match self.frame_count.try_write() {
|
||||
Ok(mut guard) => {
|
||||
if *guard > 0 {
|
||||
*guard -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
PipelineType::Time => {
|
||||
match self.time_count.try_write() {
|
||||
Ok(mut guard) => { if *guard > 0 { *guard -= 1; } }
|
||||
Err(_) => error!("[ProcessorCleanupGuard] Failed to release time slot for job {}", self.job_id),
|
||||
Err(_) => error!(
|
||||
"[ProcessorCleanupGuard] Failed to release frame slot for job {}",
|
||||
self.job_id
|
||||
),
|
||||
},
|
||||
PipelineType::Time => match self.time_count.try_write() {
|
||||
Ok(mut guard) => {
|
||||
if *guard > 0 {
|
||||
*guard -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(_) => error!(
|
||||
"[ProcessorCleanupGuard] Failed to release time slot for job {}",
|
||||
self.job_id
|
||||
),
|
||||
},
|
||||
PipelineType::Cross => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user