Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
9f5e14f1
Commit
9f5e14f1
authored
Feb 07, 2024
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: raise NEOStorageError instead of POSException.StorageError on protocol error
parent
4039f4da
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
neo/client/handlers/__init__.py
neo/client/handlers/__init__.py
+3
-2
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+2
-3
tools/stress
tools/stress
+2
-1
No files found.
neo/client/handlers/__init__.py
View file @
9f5e14f1
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
neo.lib
import
handler
from
neo.lib
import
handler
from
ZODB.POSException
import
StorageError
,
ReadOnlyError
from
..exception
import
NEOStorageError
from
ZODB.POSException
import
ReadOnlyError
class
AnswerBaseHandler
(
handler
.
AnswerBaseHandler
):
# XXX
class
AnswerBaseHandler
(
handler
.
AnswerBaseHandler
):
# XXX
def
protocolError
(
self
,
conn
,
message
):
def
protocolError
(
self
,
conn
,
message
):
raise
StorageError
(
"protocol error: %s"
%
message
)
raise
NEO
StorageError
(
"protocol error: %s"
%
message
)
def
readOnlyAccess
(
self
,
conn
,
message
):
def
readOnlyAccess
(
self
,
conn
,
message
):
raise
ReadOnlyError
(
message
)
raise
ReadOnlyError
(
message
)
neo/tests/threaded/test.py
View file @
9f5e14f1
...
@@ -1391,8 +1391,7 @@ class Test(NEOThreadedTest):
...
@@ -1391,8 +1391,7 @@ class Test(NEOThreadedTest):
client
.
tpc_begin
(
None
,
txn
)
client
.
tpc_begin
(
None
,
txn
)
txn_context
=
client
.
_txn_container
.
get
(
txn
)
txn_context
=
client
.
_txn_container
.
get
(
txn
)
txn_context
.
ttid
=
add64
(
txn_context
.
ttid
,
1
)
txn_context
.
ttid
=
add64
(
txn_context
.
ttid
,
1
)
self
.
assertRaises
(
POSException
.
StorageError
,
self
.
assertRaises
(
NEOStorageError
,
client
.
tpc_finish
,
txn
)
client
.
tpc_finish
,
txn
)
@
with_cluster
()
@
with_cluster
()
def
testStorageFailureDuringTpcFinish
(
self
,
cluster
):
def
testStorageFailureDuringTpcFinish
(
self
,
cluster
):
...
@@ -1497,7 +1496,7 @@ class Test(NEOThreadedTest):
...
@@ -1497,7 +1496,7 @@ class Test(NEOThreadedTest):
t
,
c
=
cluster
.
getTransaction
()
t
,
c
=
cluster
.
getTransaction
()
c
.
root
()[
'x'
]
=
PCounter
()
# 1 store() to each storage
c
.
root
()[
'x'
]
=
PCounter
()
# 1 store() to each storage
with
Patch
(
cluster
.
client
,
waitStoreResponses
=
waitStoreResponses
):
with
Patch
(
cluster
.
client
,
waitStoreResponses
=
waitStoreResponses
):
self
.
assertRaises
(
POSException
.
StorageError
,
t
.
commit
)
self
.
assertRaises
(
NEO
StorageError
,
t
.
commit
)
self
.
assertEqual
(
cluster
.
neoctl
.
getClusterState
(),
self
.
assertEqual
(
cluster
.
neoctl
.
getClusterState
(),
ClusterStates
.
RUNNING
)
ClusterStates
.
RUNNING
)
...
...
tools/stress
View file @
9f5e14f1
...
@@ -12,6 +12,7 @@ from multiprocessing.queues import SimpleQueue
...
@@ -12,6 +12,7 @@ from multiprocessing.queues import SimpleQueue
from
struct
import
Struct
from
struct
import
Struct
from
netfilterqueue
import
NetfilterQueue
from
netfilterqueue
import
NetfilterQueue
import
gevent.socket
# preload for subprocesses
import
gevent.socket
# preload for subprocesses
from
neo.client.exception
import
NEOStorageError
from
neo.client.Storage
import
Storage
from
neo.client.Storage
import
Storage
from
neo.lib
import
logging
,
util
from
neo.lib
import
logging
,
util
from
neo.lib.connector
import
SocketConnector
from
neo.lib.connector
import
SocketConnector
...
@@ -149,7 +150,7 @@ class Client(Process):
...
@@ -149,7 +150,7 @@ class Client(Process):
finally
:
finally
:
self
.
setDSCP
(
nm
,
-
1
)
self
.
setDSCP
(
nm
,
-
1
)
except
(
except
(
POSException
.
StorageError
,
# XXX: 'already connected' error
NEO
StorageError
,
# XXX: 'already connected' error
POSException
.
ConflictError
,
# XXX: same but during conflict resolution
POSException
.
ConflictError
,
# XXX: same but during conflict resolution
),
e
:
),
e
:
if
'unexpected packet:'
in
str
(
e
):
if
'unexpected packet:'
in
str
(
e
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment