Skip to content

Conversation

@cgalibern
Copy link
Contributor

### Summary

This pull request includes the following changes:

- Enhanced node and peer-node validation in `job_feed_daemon_status` with added checks for unregistered nodes and improved debug logging.
- Fixed incorrect `begin` mapping in the `hbmon_log_last` upsert query and clarified error messaging in `job_feed_daemon_status.go`.
- Added `system/pushFromTableChanges` operation to extend functionality in the worker.

- Correct `begin` mapping in the `hbmon_log_last` upsert query.
- Adjust error message in `job_feed_daemon_status.go` for `heartbeatToDB` to improve clarity.
…atus`

- Add checks for unregistered nodes and peer-nodes with detailed debug logging.
Refactor row count handling by introducing `ExecContextAndCountRowsAffected` on cdb.DB
- Simplify row count handling in `job_feed_system.go` and `job_feed_node_disk.go` by replacing redundant code with `ExecContextAndCountRowsAffected`.
- Add `ExecContextAndCountRowsAffected` utility function to `cdb/db.go` for consistent query execution and row count retrieval.
- Fix nil pointer
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xceda8e]

    goroutine 2289 [running]:
    github.com/opensvc/oc3/worker.(*jobFeedSystem).targets(0xc0003ec000, {0x2303e98, 0x29b12c0})
        .../worker/job_feed_system.go:157 +0x4ce
    github.com/opensvc/oc3/worker.runOps({0x2303e98, 0x29b12c0}, {0xc0000945a0?, 0x0?, 0xc0000360f0?})
        .../worker/base_job.go:89 +0xf7
    github.com/opensvc/oc3/worker.RunJob({0x2303e98, 0x29b12c0}, {0x2302858, 0xc0003ec000})
        .../worker/base_job.go:52 +0x285
    github.com/opensvc/oc3/worker.(*Worker).runJob(0xc0003b6e10, {0xc0003e2260, 0x2, 0x0?})
        .../worker/worker.go:202 +0x1306
    github.com/opensvc/oc3/worker.(*Worker).Run.func1.1({0xc0003e2260?, 0x0?, 0x0?})
        .../worker/worker.go:96 +0x5c
    created by github.com/opensvc/oc3/worker.(*Worker).Run.func1 in goroutine 32
        .../worker/worker.go:94 +0x67
…t` utility in `cdb`.

- Replaced verbose `ExecContext` and `RowsAffected` logic with `execCountContext` for consistent row count retrieval across database operations.
- Improved code clarity and reduced redundancy across several modules in `cdb`.
- Fix potential nil pointer dereference in the result returned by execContext
@sghf sghf merged commit bea084a into opensvc:main Jan 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants