Title: Bug: Error when running multi-processing populate with tls=False · Issue #1374 · datajoint/datajoint-python · GitHub
Open Graph Title: Bug: Error when running multi-processing populate with tls=False · Issue #1374 · datajoint/datajoint-python
X Title: Bug: Error when running multi-processing populate with tls=False · Issue #1374 · datajoint/datajoint-python
Description: Bug Report Description When running a populate of a table with dj.config.database.use_tls = False, when multiprocessing (e.g. processes=5) it fails. Works with use_tls = True. Reproducibility minimal example import datajoint as dj dj.con...
Open Graph Description: Bug Report Description When running a populate of a table with dj.config.database.use_tls = False, when multiprocessing (e.g. processes=5) it fails. Works with use_tls = True. Reproducibility minim...
X Description: Bug Report Description When running a populate of a table with dj.config.database.use_tls = False, when multiprocessing (e.g. processes=5) it fails. Works with use_tls = True. Reproducibility minim...
Opengraph URL: https://github.com/datajoint/datajoint-python/issues/1374
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug: Error when running multi-processing populate with tls=False","articleBody":"## Bug Report\n\n### Description\nWhen running a populate of a table with dj.config.database.use_tls = False, when multiprocessing (e.g. processes=5) it fails. Works with use_tls = True.\n\n### Reproducibility\nminimal example\n\n```\nimport datajoint as dj\ndj.config.database.use_tls = False\ndj.conn() # using datajoint.json\nschema = dj.Schema(\"TEST\")\n\n@schema\nclass Numbers(dj.Lookup):\n definition = \"\"\"\n number: int64\n \"\"\"\n contents = [(0,), (1,), (2,), (4,), (8,)]\n\n@schema\nclass NumbersSquared(dj.Computed):\n definition = \"\"\"\n -\u003e Numbers\n ---\n squared: int64\n \"\"\"\n\n def make(self, key):\n self.insert1({**key, \"squared\": key[\"number\"] ** 2})\nNumbersSquared.populate(suppress_errors=True, reserve_jobs=True, processes=5)\n```\n\n\n\nfails with \n```\n---------------------------------------------------------------------------\nAttributeError Traceback (most recent call last)\nCell In[1], line 23\n 21 def make(self, key):\n 22 self.insert1({**key, \"squared\": key[\"number\"] ** 2})\n---\u003e 23 NumbersSquared.populate(suppress_errors=True, reserve_jobs=True, processes=5)\n\nFile ~/datajoint-python/src/datajoint/autopopulate.py:366, in AutoPopulate.populate(self, suppress_errors, return_exception_objects, reserve_jobs, max_calls, display_progress, processes, make_kwargs, priority, refresh, *restrictions)\n 363 raise DataJointError(\"Populate cannot be called during a transaction.\")\n 365 if reserve_jobs:\n--\u003e 366 return self._populate_distributed(\n 367 *restrictions,\n 368 suppress_errors=suppress_errors,\n 369 return_exception_objects=return_exception_objects,\n 370 max_calls=max_calls,\n 371 display_progress=display_progress,\n 372 processes=processes,\n 373 make_kwargs=make_kwargs,\n 374 priority=priority,\n 375 refresh=refresh,\n 376 )\n 377 else:\n 378 return self._populate_direct(\n 379 *restrictions,\n 380 suppress_errors=suppress_errors,\n (...) 385 make_kwargs=make_kwargs,\n 386 )\n\nFile ~/datajoint-python/src/datajoint/autopopulate.py:525, in AutoPopulate._populate_distributed(self, suppress_errors, return_exception_objects, max_calls, display_progress, processes, make_kwargs, priority, refresh, *restrictions)\n 521 # status is False means job was already reserved\n 522 else:\n 523 # spawn multiple processes\n 524 self.connection.close()\n--\u003e 525 del self.connection._conn.ctx # SSLContext is not pickleable\n 526 with (\n 527 mp.Pool(processes, _initialize_populate, (self, self.jobs, populate_kwargs)) as pool,\n 528 tqdm(desc=\"Processes: \", total=nkeys)\n 529 if display_progress\n 530 else contextlib.nullcontext() as progress_bar,\n 531 ):\n 532 for status in pool.imap(_call_populate1, keys, chunksize=1):\n\nAttributeError: 'Connection' object has no attribute 'ctx'\n```\n\nUbuntu 24.04, python 3.12.11\nMySQL - remotely accessed myslq-latest docker (MySQL Server 9.6.0-1.el9)\nDataJoint Version : DataJoint 2.0.0a27\n\n### Expected Behavior\nDelete ctx only if it exist\n\n\n```\nif getattr(self.connection._conn, 'ctx', False):\n del self.connection._conn.ctx\n```\n\n\n","author":{"url":"https://github.com/arturoptophys","@type":"Person","name":"arturoptophys"},"datePublished":"2026-02-03T17:18:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1374/datajoint-python/issues/1374"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9a8c0f05-62df-918b-7921-962726d4f2bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B90E:1DEA4C:BA128B:BE27A5:6A4DB87E |
| html-safe-nonce | cd9f2b7cfa6473b23d83b707602b67a29de261f7bc338c1e0194397267bbc5e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTBFOjFERUE0QzpCQTEyOEI6QkUyN0E1OjZBNERCODdFIiwidmlzaXRvcl9pZCI6IjQ3Nzk3ODU1NjgzODc5NzExOTgiLCJyZWdpb25fZWRnZSI6InNlYSIsInJlZ2lvbl9yZW5kZXIiOiJzZWEifQ== |
| visitor-hmac | b97c4b02412a52c1fee1a6eede065db32bff48bb0cfd384842bbb0fe81960726 |
| hovercard-subject-tag | issue:3892326399 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/datajoint/datajoint-python/1374/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71a73f24b59c0f9776ee5fd70c61cefaeb2b2c848d1722c9ab1e6d73b2d25c84/datajoint/datajoint-python/issues/1374 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71a73f24b59c0f9776ee5fd70c61cefaeb2b2c848d1722c9ab1e6d73b2d25c84/datajoint/datajoint-python/issues/1374 |
| og:image:alt | Bug Report Description When running a populate of a table with dj.config.database.use_tls = False, when multiprocessing (e.g. processes=5) it fails. Works with use_tls = True. Reproducibility minim... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arturoptophys |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32f7b614aca06e6bbd89842b1370df1328264f68 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width