Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • bliss bliss
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 538
    • Issues 538
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 147
    • Merge requests 147
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • BlissBliss
  • blissbliss
  • Merge requests
  • !3653

Resolve "gevent exception (cannot switch to a different thread): SCAN_SAVING"

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Matias Guijarro requested to merge 2715-gevent-exception-cannot-switch-to-a-different-thread-scan_saving into master Apr 19, 2021
  • Overview 16
  • Commits 1
  • Pipelines 4
  • Changes 2

Closes #2715 (closed) #2711 (closed)

ptpython uses threads which is a problem for:

  • the global Redis connection pools (only one thread can use those pools)
  • the asyncio event loop which is built on top of gevent using aiogevent (can only be used in the main thread)

So we need to remove all usage of threads in case:

  • Bliss code could be called
  • The asyncio event loop is used

All places where threads are being used which may execute Bliss code:

PythonRepl.run_async:
 asyncio.get_event_loop().run_in_executor(None, ...)

PythonInput.read:
 threading.Thread

PythonInput._create_buffer:
 ThreadedCompleter
 ThreadedAutoSuggest

All places where threads are being used which do not execute Bliss code:

PythonInput._on_input_timeout:
 asyncio.get_event_loop().run_in_executor(None, ...)
Edited Apr 19, 2021 by Wout De Nolf
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 2715-gevent-exception-cannot-switch-to-a-different-thread-scan_saving