Comments (6)
I'm currently also seeing this problem - making a simple gRPC call results in:
Error
Traceback (most recent call last):
File "[..].venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 237, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "[..].venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "[..].venv/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 236, in create_cursor
cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "[..].", line 17, in test_create_or_update_partial
response = stub.CreateOrUpdate(current_request)
File "[..].venv/lib/python3.9/site-packages/django_grpc_framework/test.py", line 47, in __call__
return self._handler.unary_unary(request, context)
File "[..].venv/lib/python3.9/site-packages/django_grpc_framework/services.py", line 51, in handler
return getattr(self, action)(request, context)
File "[..]", line 23, in CreateOrUpdate
thingy = MagicDatabaseObject.objects.get(pk=request.puzzle.database_id)
File "[..].venv/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "[..].venv/lib/python3.9/site-packages/django/db/models/query.py", line 431, in get
num = len(clone)
File "[..].venv/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__
self._fetch_all()
File "[..]..venv/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "[..].venv/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "[..].venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1173, in execute_sql
cursor = self.connection.cursor()
File "[..].venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "[..].venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
return self._cursor()
File "[..].venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 237, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "[..].venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "[..].venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 237, in _cursor
return self._prepare_cursor(self.create_cursor(name))
File "[..].venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "[..].venv/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 236, in create_cursor
cursor = self.connection.cursor()
django.db.utils.InterfaceError: connection already closed
from django-grpc-framework.
@sobolevn @fengsp - is this repository actively maintained?
from django-grpc-framework.
@boyan-quine I need more info, how to reproduce it?
from django-grpc-framework.
@fengsp The way I get this error is when I have multiple test cases in the same file and run them at the same time - it works if I run them one-by-one, but not when I run them all - I saw a few forks removing the db.close_old_connections
call and it works if it's removed, but not sure what are the consequences:
https://github.com/fengsp/django-grpc-framework/blob/master/django_grpc_framework/services.py#L45
E.g.
Fork 1: https://github.com/findspace-inc/django-grpc-framework/commit/7edb61ab81b4694b321b70032fbcb10a24dd29c4
Fork 2: algori-io@fe43670#diff-e96daad5bed2c5ae0c073219f7f11722d5c064d7e91b433bdffee8c2264f50d1L45
from django-grpc-framework.
@boyan-quine close_old_connections
is necessary in the normal request. However, we need to remove this behavior under testing, this needs fixes.
from django-grpc-framework.
Fixed in 0.2.1
from django-grpc-framework.
Related Issues (20)
- How to implement authorization with django build auth module HOT 1
- how to support secured channel
- django apps as grpc clients HOT 1
- Using both REST and gRPC HOT 1
- interceptor error HOT 3
- Logging support HOT 1
- How to enable support of the reflection API
- This project still alive? HOT 5
- Bug: serializing/deserializing of JSONfields fails HOT 1
- How to set the options of default grpc server? HOT 3
- attribute adjustment requires_system_checks
- attribute adjustment requires_system_checks
- attribute adjustment requires_system_checks HOT 2
- grpc_settings: get user_stettings does not seem to work properly ?
- howto register multiple grpc handlers from multiple apps in one django project ? HOT 1
- django-grpc-framework doesn't work with Django 4.1.1 HOT 6
- details = "Exception calling application: 'BlogProtoSerializer' object has no attribute 'proto_class'" HOT 7
- Join forces with django-socio-grpc ? HOT 4
- How to use paging queries? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-grpc-framework.