Skip to content

google.cloud.logging: RuntimeError: cannot schedule new futures after shutdown #21

Closed
@ael-computas

Description

@ael-computas

I keep receiving this exception on program shutdown and I cant figure out what to do to make a clean shutdown

Minimal code of main.py is something like this

logging.basicConfig(
    level=logging.getLevelName(logging.getLevelName("INFO")),
    format="%(asctime)s - %(name)s - [%(levelname)-5.5s]  %(message)s",
    handlers={
        logging.FileHandler("import_from_gcs_path.log")
    }
)
client = google.cloud.logging.Client()
client.setup_logging(name="example")

if __name__ == '__main__':
    logging.info(f"Importing file to platform.")
    # Some business code here, using gcs/datastore - no threading.
    logging.shutdown()

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the googleapis/python-logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions