You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Propose removing dj.kill() and dj.kill_quick() from DataJoint. These functions are database administration utilities that don't belong in a data pipeline library.
Reasoning
1. Outside DataJoint's scope
DataJoint's purpose is defining schemas and managing scientific data pipelines — not database administration. Connection management is a DBA task with dedicated tools.
2. Better alternatives exist
Tool
Capability
Direct SQL
SHOW PROCESSLIST; KILL <pid>; (MySQL) or SELECT * FROM pg_stat_activity; SELECT pg_terminate_backend(pid); (PostgreSQL)
CLI tools
mysqladmin processlist, mysqladmin kill
GUI tools
MySQL Workbench, pgAdmin, DBeaver, DataGrip
Cloud consoles
AWS RDS, Azure, GCP dashboards
Users sophisticated enough to need connection killing can use these purpose-built tools.
3. Current implementation has issues
Interactive prompts — input() makes it unusable in scripts/automation
SQL injection risk — string interpolation into queries
MySQL-only — won't work with PostgreSQL backend
Maintenance burden — supporting across backends adds complexity for marginal value
4. Security consideration
Killing database connections is a privileged operation. Exposing it as a casual dj.kill() call may encourage inappropriate use.
5. The real problem is job management
The main use case is killing stuck populate() jobs. This is better addressed by:
Job timeouts
Graceful cancellation mechanisms
Better job monitoring
...rather than raw connection termination.
Proposal
Deprecate dj.kill() and dj.kill_quick() with warning in next minor release
Remove in next major version
Document alternatives in migration guide
Alternatives for users
-- MySQL: List and kill connections
SHOW PROCESSLIST;
KILL 1234;
-- PostgreSQL: List and kill connectionsSELECT pid, usename, state, query FROM pg_stat_activity WHERE pid <> pg_backend_pid();
SELECT pg_terminate_backend(1234);
Activity
[-]Refactor dj.kill: non-interactive API + PostgreSQL support[/-][+]Remove dj.kill and dj.kill_quick[/+]feat: remove dj.kill and dj.kill_quick