Commit 745c557c authored by Vincent Pelletier's avatar Vincent Pelletier

Fix (some) pyflakes warnings in storage code.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@784 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 883bc312
......@@ -99,7 +99,6 @@ class ConnectionPool(object):
logging.info('connected to storage node %s', node)
return conn
else:
# Connection failed, notify primary master node
logging.info('Storage node %s not ready', node)
return None
......@@ -363,7 +362,7 @@ class Application(object):
def _getMasterConnection(self):
""" Connect to the primary master node on demand """
# acquire the lock to allow only one thread to connect to the primary
lock = self._connecting_to_master_node_acquire(True)
lock = self._connecting_to_master_node_acquire()
try:
if self.master_conn is None:
self.master_conn = self._connectToPrimaryMasterNode()
......
......@@ -48,6 +48,7 @@ class BaseHandler(EventHandler):
Put fake packets to task queues so that threads waiting for an
answer get notified of the disconnection.
"""
# XXX: not thread-safe !
queue_set = set()
conn_id = id(conn)
for key in self.dispatcher.message_table.keys():
......
......@@ -16,16 +16,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import logging
import os, sys
import sys
from time import time
from struct import unpack, pack
from struct import unpack
from collections import deque
from neo.config import ConfigurationManager
from neo import protocol
from neo.protocol import TEMPORARILY_DOWN_STATE, DOWN_STATE, BROKEN_STATE, \
INVALID_UUID, INVALID_PTID, partition_cell_states, HIDDEN_STATE
from neo.node import NodeManager, MasterNode, StorageNode, ClientNode
from neo.protocol import TEMPORARILY_DOWN_STATE, INVALID_UUID, INVALID_PTID, \
partition_cell_states, HIDDEN_STATE
from neo.node import NodeManager, MasterNode, StorageNode
from neo.event import EventManager
from neo.storage.mysqldb import MySQLDatabaseManager
from neo.connection import ListeningConnection, ClientConnection
......
......@@ -25,7 +25,6 @@ from struct import pack, unpack
from neo.storage.database import DatabaseManager
from neo.exception import DatabaseFailure
from neo.util import dump
from neo.protocol import DISCARDED_STATE, INVALID_PTID
def p64(n):
......
......@@ -21,12 +21,10 @@ from random import choice
from neo.storage.handlers.handler import StorageEventHandler
from neo.storage.handlers.replication import ReplicationEventHandler
from neo import protocol
from neo.protocol import Packet, STORAGE_NODE_TYPE, \
UP_TO_DATE_STATE, OUT_OF_DATE_STATE, \
INVALID_OID, INVALID_TID, RUNNING_STATE
from neo.protocol import STORAGE_NODE_TYPE, UP_TO_DATE_STATE, \
OUT_OF_DATE_STATE, INVALID_TID, RUNNING_STATE
from neo.connection import ClientConnection
from neo.util import dump
from neo import protocol
class Partition(object):
"""This class abstracts the state of a partition."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment