Commit 078c7786 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Change some log message level, especially info to debug.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@866 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9a7e39d9
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# The cluster name # The cluster name
name: main name: main
# The list of master nodes. # The list of master nodes.
master_nodes: 127.0.0.1:10010 127.0.0.1:10011 master_nodes: 127.0.0.1:10010 127.0.0.1:10011
# Partition table configuration # Partition table configuration
replicas: 1 replicas: 1
partitions: 20 partitions: 20
...@@ -33,3 +33,11 @@ server: 127.0.0.1:10020 ...@@ -33,3 +33,11 @@ server: 127.0.0.1:10020
database: neo2 database: neo2
server: 127.0.0.1:10021 server: 127.0.0.1:10021
[storage3]
database: neo3
server: 127.0.0.1:10022
[storage4]
database: neo4
server: 127.0.0.1:10023
...@@ -111,7 +111,7 @@ class ConnectionPool(object): ...@@ -111,7 +111,7 @@ class ConnectionPool(object):
not self.app.dispatcher.registered(conn): not self.app.dispatcher.registered(conn):
del self.connection_dict[conn.getUUID()] del self.connection_dict[conn.getUUID()]
conn.close() conn.close()
logging.info('_dropConnections : connection to storage node %s:%d closed', logging.debug('_dropConnections : connection to storage node %s:%d closed',
*(conn.getAddress())) *(conn.getAddress()))
if len(self.connection_dict) <= self.max_pool_size: if len(self.connection_dict) <= self.max_pool_size:
break break
...@@ -666,7 +666,6 @@ class Application(object): ...@@ -666,7 +666,6 @@ class Application(object):
checksum = makeChecksum(compressed_data) checksum = makeChecksum(compressed_data)
self.local_var.object_stored_counter = 0 self.local_var.object_stored_counter = 0
for cell in cell_list: for cell in cell_list:
#logging.info("storing object %s %s" %(cell.getServer(),cell.getState()))
conn = self.cp.getConnForCell(cell) conn = self.cp.getConnForCell(cell)
if conn is None: if conn is None:
continue continue
...@@ -899,7 +898,7 @@ class Application(object): ...@@ -899,7 +898,7 @@ class Application(object):
ordered_tids = list(ordered_tids) ordered_tids = list(ordered_tids)
# XXX do we need a special cmp function here ? # XXX do we need a special cmp function here ?
ordered_tids.sort(reverse=True) ordered_tids.sort(reverse=True)
logging.info("UndoLog, tids %s", ordered_tids) logging.debug("UndoLog, tids %s", ordered_tids)
# For each transaction, get info # For each transaction, get info
undo_info = [] undo_info = []
append = undo_info.append append = undo_info.append
......
...@@ -231,7 +231,7 @@ class PrimaryNotificationsHandler(BaseHandler): ...@@ -231,7 +231,7 @@ class PrimaryNotificationsHandler(BaseHandler):
app = self.app app = self.app
nm = app.nm nm = app.nm
for node_type, ip_address, port, uuid, state in node_list: for node_type, ip_address, port, uuid, state in node_list:
logging.info("notified of %s %s %d %s %s" %(node_type, ip_address, port, dump(uuid), state)) logging.debug("notified of %s %s %d %s %s" %(node_type, ip_address, port, dump(uuid), state))
# Register new nodes. # Register new nodes.
addr = (ip_address, port) addr = (ip_address, port)
# Try to retrieve it from nm # Try to retrieve it from nm
......
...@@ -35,7 +35,7 @@ class ThreadedPoll(Thread): ...@@ -35,7 +35,7 @@ class ThreadedPoll(Thread):
self.em.poll() self.em.poll()
except: except:
logging.error('poll raised, retrying', exc_info=1) logging.error('poll raised, retrying', exc_info=1)
logging.info('Threaded poll stopped') logging.debug('Threaded poll stopped')
def stop(self): def stop(self):
self._stop.set() self._stop.set()
...@@ -131,7 +131,7 @@ class ListeningConnection(BaseConnection): ...@@ -131,7 +131,7 @@ class ListeningConnection(BaseConnection):
"""A listen connection.""" """A listen connection."""
def __init__(self, event_manager, handler, addr = None, def __init__(self, event_manager, handler, addr = None,
connector_handler = None, **kw): connector_handler = None, **kw):
logging.info('listening to %s:%d', *addr) logging.debug('listening to %s:%d', *addr)
BaseConnection.__init__(self, event_manager, handler, BaseConnection.__init__(self, event_manager, handler,
addr = addr, addr = addr,
connector_handler = connector_handler) connector_handler = connector_handler)
...@@ -143,7 +143,7 @@ class ListeningConnection(BaseConnection): ...@@ -143,7 +143,7 @@ class ListeningConnection(BaseConnection):
def readable(self): def readable(self):
try: try:
new_s, addr = self.connector.getNewConnection() new_s, addr = self.connector.getNewConnection()
logging.info('accepted a connection from %s:%d', *addr) logging.debug('accepted a connection from %s:%d', *addr)
self.handler.connectionAccepted(self, new_s, addr) self.handler.connectionAccepted(self, new_s, addr)
except ConnectorTryAgainException: except ConnectorTryAgainException:
pass pass
...@@ -282,7 +282,7 @@ class Connection(BaseConnection): ...@@ -282,7 +282,7 @@ class Connection(BaseConnection):
try: try:
data = self.connector.receive() data = self.connector.receive()
if not data: if not data:
logging.info('Connection %r closed in recv', self.connector) logging.debug('Connection %r closed in recv', self.connector)
self.close() self.close()
self.handler.connectionClosed(self) self.handler.connectionClosed(self)
return return
...@@ -296,11 +296,11 @@ class Connection(BaseConnection): ...@@ -296,11 +296,11 @@ class Connection(BaseConnection):
except ConnectorConnectionClosedException: except ConnectorConnectionClosedException:
# connection resetted by peer, according to the man, this error # connection resetted by peer, according to the man, this error
# should not occurs but it seems it's false # should not occurs but it seems it's false
logging.info('Connection reset by peer: %r', self.connector) logging.debug('Connection reset by peer: %r', self.connector)
self.close() self.close()
self.handler.connectionClosed(self) self.handler.connectionClosed(self)
except ConnectorException: except ConnectorException:
logging.info('Unknown connection error: %r', self.connector) logging.debug('Unknown connection error: %r', self.connector)
self.close() self.close()
self.handler.connectionClosed(self) self.handler.connectionClosed(self)
# unhandled connector exception # unhandled connector exception
...@@ -313,7 +313,7 @@ class Connection(BaseConnection): ...@@ -313,7 +313,7 @@ class Connection(BaseConnection):
try: try:
n = self.connector.send(self.write_buf) n = self.connector.send(self.write_buf)
if not n: if not n:
logging.info('Connection %r closed in send', self.connector) logging.debug('Connection %r closed in send', self.connector)
self.handler.connectionClosed(self) self.handler.connectionClosed(self)
self.close() self.close()
return return
...@@ -322,11 +322,11 @@ class Connection(BaseConnection): ...@@ -322,11 +322,11 @@ class Connection(BaseConnection):
pass pass
except ConnectorConnectionClosedException: except ConnectorConnectionClosedException:
# connection resetted by peer # connection resetted by peer
logging.info('Connection reset by peer: %r', self.connector) logging.debug('Connection reset by peer: %r', self.connector)
self.close() self.close()
self.handler.connectionClosed(self) self.handler.connectionClosed(self)
except ConnectorException: except ConnectorException:
logging.info('Unknown connection error: %r', self.connector) logging.debug('Unknown connection error: %r', self.connector)
# unhandled connector exception # unhandled connector exception
self.close() self.close()
self.handler.connectionClosed(self) self.handler.connectionClosed(self)
......
...@@ -68,7 +68,7 @@ class SocketConnector: ...@@ -68,7 +68,7 @@ class SocketConnector:
raise ConnectorConnectionRefusedException raise ConnectorConnectionRefusedException
raise ConnectorException, 'makeClientConnection failed: %s:%s' % (err, errmsg) raise ConnectorException, 'makeClientConnection failed: %s:%s' % (err, errmsg)
finally: finally:
logging.info('%r connecting to %r', self.socket.getsockname(), addr) logging.debug('%r connecting to %r', self.socket.getsockname(), addr)
def makeListeningConnection(self, addr): def makeListeningConnection(self, addr):
self.is_closed = False self.is_closed = False
......
...@@ -62,7 +62,6 @@ class IdleEvent(object): ...@@ -62,7 +62,6 @@ class IdleEvent(object):
self._additional_timeout -= 5 self._additional_timeout -= 5
conn.expectMessage(self._id, 5, self._additional_timeout) conn.expectMessage(self._id, 5, self._additional_timeout)
# Start a keep-alive packet. # Start a keep-alive packet.
logging.info('sending a ping to %s:%d', *(conn.getAddress()))
conn.ask(protocol.ping(), 5, 0) conn.ask(protocol.ping(), 5, 0)
else: else:
conn.expectMessage(self._id, self._additional_timeout, 0) conn.expectMessage(self._id, self._additional_timeout, 0)
...@@ -250,7 +249,6 @@ class EpollEventManager(object): ...@@ -250,7 +249,6 @@ class EpollEventManager(object):
except KeyError: except KeyError:
pass pass
else: else:
#logging.info("conn is %s" %(conn,))
conn.lock() conn.lock()
try: try:
conn.readable() conn.readable()
......
...@@ -94,9 +94,9 @@ class EventHandler(object): ...@@ -94,9 +94,9 @@ class EventHandler(object):
args = (conn.getAddress()[0], conn.getAddress()[1], message) args = (conn.getAddress()[0], conn.getAddress()[1], message)
if packet is None: if packet is None:
# if decoding fail, there's no packet instance # if decoding fail, there's no packet instance
logging.info('malformed packet from %s:%d: %s', *args) logging.error('malformed packet from %s:%d: %s', *args)
else: else:
logging.info('malformed packet %s from %s:%d: %s', packet.getType(), *args) logging.error('malformed packet %s from %s:%d: %s', packet.getType(), *args)
response = protocol.protocolError(message) response = protocol.protocolError(message)
if packet is not None: if packet is not None:
conn.answer(response, packet) conn.answer(response, packet)
...@@ -113,7 +113,7 @@ class EventHandler(object): ...@@ -113,7 +113,7 @@ class EventHandler(object):
else: else:
message = 'unexpected packet: %s in %s' % (message, message = 'unexpected packet: %s in %s' % (message,
self.__class__.__name__) self.__class__.__name__)
logging.info('%s', message) logging.error('%s', message)
conn.answer(protocol.protocolError(message), packet) conn.answer(protocol.protocolError(message), packet)
conn.abort() conn.abort()
self.peerBroken(conn) self.peerBroken(conn)
...@@ -179,7 +179,7 @@ class EventHandler(object): ...@@ -179,7 +179,7 @@ class EventHandler(object):
raise UnexpectedPacketError raise UnexpectedPacketError
def handlePing(self, conn, packet): def handlePing(self, conn, packet):
logging.info('got a ping packet; am I overloaded?') logging.debug('got a ping packet; am I overloaded?')
conn.answer(protocol.pong(), packet) conn.answer(protocol.pong(), packet)
def handlePong(self, conn, packet): def handlePong(self, conn, packet):
...@@ -386,7 +386,7 @@ class EventHandler(object): ...@@ -386,7 +386,7 @@ class EventHandler(object):
conn.close() conn.close()
def handleNoError(self, conn, packet, message): def handleNoError(self, conn, packet, message):
logging.info("no error message : %s" %(message)) logging.debug("no error message : %s" %(message))
def initPacketDispatchTable(self): def initPacketDispatchTable(self):
d = {} d = {}
......
...@@ -182,7 +182,7 @@ class Application(object): ...@@ -182,7 +182,7 @@ class Application(object):
if self.primary is None: if self.primary is None:
# I am the primary. # I am the primary.
self.primary = True self.primary = True
logging.info('I am the primary, so sending an announcement') logging.debug('I am the primary, so sending an announcement')
for conn in em.getConnectionList(): for conn in em.getConnectionList():
if isinstance(conn, ClientConnection): if isinstance(conn, ClientConnection):
conn.notify(protocol.announcePrimaryMaster()) conn.notify(protocol.announcePrimaryMaster())
...@@ -302,7 +302,7 @@ class Application(object): ...@@ -302,7 +302,7 @@ class Application(object):
def broadcastPartitionChanges(self, ptid, cell_list): def broadcastPartitionChanges(self, ptid, cell_list):
"""Broadcast a Notify Partition Changes packet.""" """Broadcast a Notify Partition Changes packet."""
logging.info('broadcastPartitionChanges') logging.debug('broadcastPartitionChanges')
self.pt.log() self.pt.log()
for c in self.em.getConnectionList(): for c in self.em.getConnectionList():
if c.getUUID() is not None: if c.getUUID() is not None:
...@@ -391,7 +391,7 @@ class Application(object): ...@@ -391,7 +391,7 @@ class Application(object):
# FIXME: storage node with existing partition but not in the selected PT # FIXME: storage node with existing partition but not in the selected PT
# must switch to PENDING state or be disconnected to restarts from nothing # must switch to PENDING state or be disconnected to restarts from nothing
logging.info('cluster starts with this partition table :') logging.debug('cluster starts with this partition table :')
self.pt.log() self.pt.log()
def verifyTransaction(self, tid): def verifyTransaction(self, tid):
...@@ -465,7 +465,7 @@ class Application(object): ...@@ -465,7 +465,7 @@ class Application(object):
self.changeClusterState(protocol.VERIFYING) self.changeClusterState(protocol.VERIFYING)
# wait for any missing node # wait for any missing node
logging.info('waiting for the cluster to be operational') logging.debug('waiting for the cluster to be operational')
while not self.pt.operational(): while not self.pt.operational():
em.poll(1) em.poll(1)
......
...@@ -156,7 +156,7 @@ class Application(object): ...@@ -156,7 +156,7 @@ class Application(object):
self.em.poll(1) self.em.poll(1)
if conn is None: if conn is None:
self.trying_admin_node = True self.trying_admin_node = True
logging.info('connecting to address %s:%d', *(self.server)) logging.debug('connecting to address %s:%d', *(self.server))
conn = ClientConnection(self.em, handler, \ conn = ClientConnection(self.em, handler, \
addr = self.server, addr = self.server,
connector_handler = self.connector_handler) connector_handler = self.connector_handler)
......
...@@ -218,7 +218,7 @@ class Application(object): ...@@ -218,7 +218,7 @@ class Application(object):
def initialize(self): def initialize(self):
""" Retreive partition table and node informations from the primary """ """ Retreive partition table and node informations from the primary """
logging.info('initializing...') logging.debug('initializing...')
handler = handlers.InitializationHandler(self) handler = handlers.InitializationHandler(self)
self.master_conn.setHandler(handler) self.master_conn.setHandler(handler)
......
...@@ -103,7 +103,7 @@ class HiddenHandler(BaseMasterHandler): ...@@ -103,7 +103,7 @@ class HiddenHandler(BaseMasterHandler):
pt = app.pt pt = app.pt
if app.ptid >= ptid: if app.ptid >= ptid:
# Ignore this packet. # Ignore this packet.
logging.info('ignoring older partition changes') logging.debug('ignoring older partition changes')
return return
# First, change the table on memory. # First, change the table on memory.
...@@ -174,18 +174,18 @@ class HiddenHandler(BaseMasterHandler): ...@@ -174,18 +174,18 @@ class HiddenHandler(BaseMasterHandler):
pass pass
def handleAbortTransaction(self, conn, packet, tid): def handleAbortTransaction(self, conn, packet, tid):
logging.info('ignoring abort transaction') logging.debug('ignoring abort transaction')
pass pass
def handleAnswerLastIDs(self, conn, packet, loid, ltid, lptid): def handleAnswerLastIDs(self, conn, packet, loid, ltid, lptid):
logging.info('ignoring answer last ids') logging.debug('ignoring answer last ids')
pass pass
def handleAnswerUnfinishedTransactions(self, conn, packet, tid_list): def handleAnswerUnfinishedTransactions(self, conn, packet, tid_list):
logging.info('ignoring answer unfinished transactions') logging.debug('ignoring answer unfinished transactions')
pass pass
def handleAskOIDs(self, conn, packet, first, last, partition): def handleAskOIDs(self, conn, packet, first, last, partition):
logging.info('ignoring ask oids') logging.debug('ignoring ask oids')
pass pass
...@@ -67,7 +67,7 @@ class InitializationHandler(BaseMasterHandler): ...@@ -67,7 +67,7 @@ class InitializationHandler(BaseMasterHandler):
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list): def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
assert not row_list assert not row_list
self.app.has_partition_table = True self.app.has_partition_table = True
logging.info('Got the partition table :') logging.debug('Got the partition table :')
self.app.pt.log() self.app.pt.log()
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list): def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
...@@ -75,4 +75,4 @@ class InitializationHandler(BaseMasterHandler): ...@@ -75,4 +75,4 @@ class InitializationHandler(BaseMasterHandler):
# single threaded, it send the partition table without any changes at # single threaded, it send the partition table without any changes at
# the same time. Latter it should be needed to put in queue any changes # the same time. Latter it should be needed to put in queue any changes
# and apply them when the initial partition is filled. # and apply them when the initial partition is filled.
logging.info('ignoring notifyPartitionChanges during initialization') logging.debug('ignoring notifyPartitionChanges during initialization')
...@@ -47,7 +47,7 @@ class MasterOperationHandler(BaseMasterHandler): ...@@ -47,7 +47,7 @@ class MasterOperationHandler(BaseMasterHandler):
pt = app.pt pt = app.pt
if app.ptid >= ptid: if app.ptid >= ptid:
# Ignore this packet. # Ignore this packet.
logging.info('ignoring older partition changes') logging.debug('ignoring older partition changes')
return return
# First, change the table on memory. # First, change the table on memory.
...@@ -70,7 +70,7 @@ class MasterOperationHandler(BaseMasterHandler): ...@@ -70,7 +70,7 @@ class MasterOperationHandler(BaseMasterHandler):
# Then, the database. # Then, the database.
app.dm.changePartitionTable(ptid, cell_list) app.dm.changePartitionTable(ptid, cell_list)
logging.info('Partition table updated:') logging.debug('Partition table updated:')
self.app.pt.log() self.app.pt.log()
def handleLockInformation(self, conn, packet, tid): def handleLockInformation(self, conn, packet, tid):
......
...@@ -65,7 +65,7 @@ class VerificationHandler(BaseMasterHandler): ...@@ -65,7 +65,7 @@ class VerificationHandler(BaseMasterHandler):
pt = app.pt pt = app.pt
if app.ptid >= ptid: if app.ptid >= ptid:
# Ignore this packet. # Ignore this packet.
logging.info('ignoring older partition changes') logging.debug('ignoring older partition changes')
return return
# First, change the table on memory. # First, change the table on memory.
......
...@@ -126,7 +126,7 @@ class Replicator(object): ...@@ -126,7 +126,7 @@ class Replicator(object):
partition.setCriticalTID(tid) partition.setCriticalTID(tid)
del self.critical_tid_dict[msg_id] del self.critical_tid_dict[msg_id]
except KeyError: except KeyError:
logging.info("setCriticalTID raised KeyError for msg_id %s" %(msg_id,)) logging.debug("setCriticalTID raised KeyError for msg_id %s" %(msg_id,))
def _askCriticalTID(self): def _askCriticalTID(self):
conn = self.primary_master_connection conn = self.primary_master_connection
......
...@@ -31,7 +31,7 @@ TEST_MODULES = [ ...@@ -31,7 +31,7 @@ TEST_MODULES = [
# configuration # configuration
WITH_ZODB_TESTS = False WITH_ZODB_TESTS = False
SEND_REPORT = True SEND_REPORT = False
CONSOLE_LOG = False CONSOLE_LOG = False
ATTACH_LOG = False # for ZODB test, only the client side is logged ATTACH_LOG = False # for ZODB test, only the client side is logged
LOG_FILE = 'neo.log' LOG_FILE = 'neo.log'
......
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