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 @@
# The cluster name
name: main
# 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
replicas: 1
partitions: 20
......@@ -33,3 +33,11 @@ server: 127.0.0.1:10020
database: neo2
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):
not self.app.dispatcher.registered(conn):
del self.connection_dict[conn.getUUID()]
conn.close()
logging.info('_dropConnections : connection to storage node %s:%d closed',
logging.debug('_dropConnections : connection to storage node %s:%d closed',
*(conn.getAddress()))
if len(self.connection_dict) <= self.max_pool_size:
break
......@@ -666,7 +666,6 @@ class Application(object):
checksum = makeChecksum(compressed_data)
self.local_var.object_stored_counter = 0
for cell in cell_list:
#logging.info("storing object %s %s" %(cell.getServer(),cell.getState()))
conn = self.cp.getConnForCell(cell)
if conn is None:
continue
......@@ -899,7 +898,7 @@ class Application(object):
ordered_tids = list(ordered_tids)
# XXX do we need a special cmp function here ?
ordered_tids.sort(reverse=True)
logging.info("UndoLog, tids %s", ordered_tids)
logging.debug("UndoLog, tids %s", ordered_tids)
# For each transaction, get info
undo_info = []
append = undo_info.append
......
......@@ -231,7 +231,7 @@ class PrimaryNotificationsHandler(BaseHandler):
app = self.app
nm = app.nm
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.
addr = (ip_address, port)
# Try to retrieve it from nm
......
......@@ -35,7 +35,7 @@ class ThreadedPoll(Thread):
self.em.poll()
except:
logging.error('poll raised, retrying', exc_info=1)
logging.info('Threaded poll stopped')
logging.debug('Threaded poll stopped')
def stop(self):
self._stop.set()
......@@ -131,7 +131,7 @@ class ListeningConnection(BaseConnection):
"""A listen connection."""
def __init__(self, event_manager, handler, addr = None,
connector_handler = None, **kw):
logging.info('listening to %s:%d', *addr)
logging.debug('listening to %s:%d', *addr)
BaseConnection.__init__(self, event_manager, handler,
addr = addr,
connector_handler = connector_handler)
......@@ -143,7 +143,7 @@ class ListeningConnection(BaseConnection):
def readable(self):
try:
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)
except ConnectorTryAgainException:
pass
......@@ -282,7 +282,7 @@ class Connection(BaseConnection):
try:
data = self.connector.receive()
if not data:
logging.info('Connection %r closed in recv', self.connector)
logging.debug('Connection %r closed in recv', self.connector)
self.close()
self.handler.connectionClosed(self)
return
......@@ -296,11 +296,11 @@ class Connection(BaseConnection):
except ConnectorConnectionClosedException:
# connection resetted by peer, according to the man, this error
# 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.handler.connectionClosed(self)
except ConnectorException:
logging.info('Unknown connection error: %r', self.connector)
logging.debug('Unknown connection error: %r', self.connector)
self.close()
self.handler.connectionClosed(self)
# unhandled connector exception
......@@ -313,7 +313,7 @@ class Connection(BaseConnection):
try:
n = self.connector.send(self.write_buf)
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.close()
return
......@@ -322,11 +322,11 @@ class Connection(BaseConnection):
pass
except ConnectorConnectionClosedException:
# 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.handler.connectionClosed(self)
except ConnectorException:
logging.info('Unknown connection error: %r', self.connector)
logging.debug('Unknown connection error: %r', self.connector)
# unhandled connector exception
self.close()
self.handler.connectionClosed(self)
......
......@@ -68,7 +68,7 @@ class SocketConnector:
raise ConnectorConnectionRefusedException
raise ConnectorException, 'makeClientConnection failed: %s:%s' % (err, errmsg)
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):
self.is_closed = False
......
......@@ -62,7 +62,6 @@ class IdleEvent(object):
self._additional_timeout -= 5
conn.expectMessage(self._id, 5, self._additional_timeout)
# Start a keep-alive packet.
logging.info('sending a ping to %s:%d', *(conn.getAddress()))
conn.ask(protocol.ping(), 5, 0)
else:
conn.expectMessage(self._id, self._additional_timeout, 0)
......@@ -250,7 +249,6 @@ class EpollEventManager(object):
except KeyError:
pass
else:
#logging.info("conn is %s" %(conn,))
conn.lock()
try:
conn.readable()
......
......@@ -94,9 +94,9 @@ class EventHandler(object):
args = (conn.getAddress()[0], conn.getAddress()[1], message)
if packet is None:
# 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:
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)
if packet is not None:
conn.answer(response, packet)
......@@ -113,7 +113,7 @@ class EventHandler(object):
else:
message = 'unexpected packet: %s in %s' % (message,
self.__class__.__name__)
logging.info('%s', message)
logging.error('%s', message)
conn.answer(protocol.protocolError(message), packet)
conn.abort()
self.peerBroken(conn)
......@@ -179,7 +179,7 @@ class EventHandler(object):
raise UnexpectedPacketError
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)
def handlePong(self, conn, packet):
......@@ -386,7 +386,7 @@ class EventHandler(object):
conn.close()
def handleNoError(self, conn, packet, message):
logging.info("no error message : %s" %(message))
logging.debug("no error message : %s" %(message))
def initPacketDispatchTable(self):
d = {}
......
......@@ -182,7 +182,7 @@ class Application(object):
if self.primary is None:
# I am the primary.
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():
if isinstance(conn, ClientConnection):
conn.notify(protocol.announcePrimaryMaster())
......@@ -302,7 +302,7 @@ class Application(object):
def broadcastPartitionChanges(self, ptid, cell_list):
"""Broadcast a Notify Partition Changes packet."""
logging.info('broadcastPartitionChanges')
logging.debug('broadcastPartitionChanges')
self.pt.log()
for c in self.em.getConnectionList():
if c.getUUID() is not None:
......@@ -391,7 +391,7 @@ class Application(object):
# FIXME: storage node with existing partition but not in the selected PT
# 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()
def verifyTransaction(self, tid):
......@@ -465,7 +465,7 @@ class Application(object):
self.changeClusterState(protocol.VERIFYING)
# 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():
em.poll(1)
......
......@@ -156,7 +156,7 @@ class Application(object):
self.em.poll(1)
if conn is None:
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, \
addr = self.server,
connector_handler = self.connector_handler)
......
......@@ -218,7 +218,7 @@ class Application(object):
def initialize(self):
""" Retreive partition table and node informations from the primary """
logging.info('initializing...')
logging.debug('initializing...')
handler = handlers.InitializationHandler(self)
self.master_conn.setHandler(handler)
......
......@@ -103,7 +103,7 @@ class HiddenHandler(BaseMasterHandler):
pt = app.pt
if app.ptid >= ptid:
# Ignore this packet.
logging.info('ignoring older partition changes')
logging.debug('ignoring older partition changes')
return
# First, change the table on memory.
......@@ -174,18 +174,18 @@ class HiddenHandler(BaseMasterHandler):
pass
def handleAbortTransaction(self, conn, packet, tid):
logging.info('ignoring abort transaction')
logging.debug('ignoring abort transaction')
pass
def handleAnswerLastIDs(self, conn, packet, loid, ltid, lptid):
logging.info('ignoring answer last ids')
logging.debug('ignoring answer last ids')
pass
def handleAnswerUnfinishedTransactions(self, conn, packet, tid_list):
logging.info('ignoring answer unfinished transactions')
logging.debug('ignoring answer unfinished transactions')
pass
def handleAskOIDs(self, conn, packet, first, last, partition):
logging.info('ignoring ask oids')
logging.debug('ignoring ask oids')
pass
......@@ -67,7 +67,7 @@ class InitializationHandler(BaseMasterHandler):
def handleAnswerPartitionTable(self, conn, packet, ptid, row_list):
assert not row_list
self.app.has_partition_table = True
logging.info('Got the partition table :')
logging.debug('Got the partition table :')
self.app.pt.log()
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
......@@ -75,4 +75,4 @@ class InitializationHandler(BaseMasterHandler):
# 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
# 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):
pt = app.pt
if app.ptid >= ptid:
# Ignore this packet.
logging.info('ignoring older partition changes')
logging.debug('ignoring older partition changes')
return
# First, change the table on memory.
......@@ -70,7 +70,7 @@ class MasterOperationHandler(BaseMasterHandler):
# Then, the database.
app.dm.changePartitionTable(ptid, cell_list)
logging.info('Partition table updated:')
logging.debug('Partition table updated:')
self.app.pt.log()
def handleLockInformation(self, conn, packet, tid):
......
......@@ -65,7 +65,7 @@ class VerificationHandler(BaseMasterHandler):
pt = app.pt
if app.ptid >= ptid:
# Ignore this packet.
logging.info('ignoring older partition changes')
logging.debug('ignoring older partition changes')
return
# First, change the table on memory.
......
......@@ -126,7 +126,7 @@ class Replicator(object):
partition.setCriticalTID(tid)
del self.critical_tid_dict[msg_id]
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):
conn = self.primary_master_connection
......
......@@ -31,7 +31,7 @@ TEST_MODULES = [
# configuration
WITH_ZODB_TESTS = False
SEND_REPORT = True
SEND_REPORT = False
CONSOLE_LOG = False
ATTACH_LOG = False # for ZODB test, only the client side is logged
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