Solved the addressGeneratorQueue get issue in the class_addressGeneratorQueue file
This commit is contained in:
parent
7609a3ce40
commit
afb3a22f99
|
@ -39,7 +39,7 @@ try:
|
||||||
varintDecodeError
|
varintDecodeError
|
||||||
)
|
)
|
||||||
from bmconfigparser import BMConfigParser
|
from bmconfigparser import BMConfigParser
|
||||||
from debug import logger
|
from debug import logg
|
||||||
from helper_ackPayload import genAckPayload
|
from helper_ackPayload import genAckPayload
|
||||||
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
|
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
|
||||||
from inventory import Inventory
|
from inventory import Inventory
|
||||||
|
@ -638,7 +638,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
try:
|
try:
|
||||||
queues.addressGeneratorQueue.put((
|
queues.addressGeneratorQueue.put((
|
||||||
'createChan', addressVersionNumber, streamNumber, label,
|
'createChan', addressVersionNumber, streamNumber, label,
|
||||||
passphrase, True
|
passphrase.decode(), True
|
||||||
))
|
))
|
||||||
logger.info(
|
logger.info(
|
||||||
'@@@@@@@@ before printing the queueReturn @@@@@@@@@')
|
'@@@@@@@@ before printing the queueReturn @@@@@@@@@')
|
||||||
|
|
|
@ -75,10 +75,15 @@ class addressGenerator(StoppableThread):
|
||||||
while state.shutdown == 0:
|
while state.shutdown == 0:
|
||||||
logger.error(
|
logger.error(
|
||||||
'qqqqqqqqq1111111111111111111111111111111')
|
'qqqqqqqqq1111111111111111111111111111111')
|
||||||
with self.lock:
|
try:
|
||||||
queueValue = queues.addressGeneratorQueue.get()
|
queueValue = queues.addressGeneratorQueue.get()
|
||||||
logger.error(
|
logger.error('SuccessFully Loaded')
|
||||||
'qqqqqqqqq2222222222222222222222222222222')
|
except Exception as e:
|
||||||
|
import traceback
|
||||||
|
logger.error('Traceback-{} \n'.format(
|
||||||
|
str(traceback.format_stack())))
|
||||||
|
logger.error('Address Genertor excepation 7777')
|
||||||
|
logger.error(e)
|
||||||
nonceTrialsPerByte = 0
|
nonceTrialsPerByte = 0
|
||||||
# logger.error('$$$$$$$$$$$$ queueValue @@@@@@@@@@@-{}'.format(queueValue))
|
# logger.error('$$$$$$$$$$$$ queueValue @@@@@@@@@@@-{}'.format(queueValue))
|
||||||
payloadLengthExtraBytes = 0
|
payloadLengthExtraBytes = 0
|
||||||
|
|
|
@ -51,7 +51,7 @@ class addressGeneratorQueueClass(Queue.Queue):
|
||||||
self.debug_file.write('Current-thread-{} \n'.format(
|
self.debug_file.write('Current-thread-{} \n'.format(
|
||||||
threading.current_thread().name))
|
threading.current_thread().name))
|
||||||
self.debug_file.write('Traceback-{} \n'.format(
|
self.debug_file.write('Traceback-{} \n'.format(
|
||||||
str(traceback.print_exc())))
|
str(traceback.format_stack())))
|
||||||
self.debug_file.write('Printig the put item-{}'.format(
|
self.debug_file.write('Printig the put item-{}'.format(
|
||||||
item))
|
item))
|
||||||
Queue.Queue.put(self, item, block, timeout)
|
Queue.Queue.put(self, item, block, timeout)
|
||||||
|
@ -63,7 +63,7 @@ class addressGeneratorQueueClass(Queue.Queue):
|
||||||
self.debug_file.write('Current-thread-{} \n '.format(
|
self.debug_file.write('Current-thread-{} \n '.format(
|
||||||
threading.current_thread().name))
|
threading.current_thread().name))
|
||||||
self.debug_file.write('Traceback-{} \n'.format(
|
self.debug_file.write('Traceback-{} \n'.format(
|
||||||
str(traceback.print_exc())))
|
str(traceback.format_stack())))
|
||||||
item = Queue.Queue.get(self, block, timeout)
|
item = Queue.Queue.get(self, block, timeout)
|
||||||
self.debug_file.write('Printig the get item-{}'.format(
|
self.debug_file.write('Printig the get item-{}'.format(
|
||||||
str(item)))
|
str(item)))
|
||||||
|
|
|
@ -31,22 +31,24 @@ def doCleanShutdown():
|
||||||
Used to tell all the treads to finish work and exit.
|
Used to tell all the treads to finish work and exit.
|
||||||
"""
|
"""
|
||||||
state.shutdown = 1
|
state.shutdown = 1
|
||||||
|
|
||||||
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
|
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
|
||||||
for thread in threading.enumerate():
|
for thread in threading.enumerate():
|
||||||
if thread.isAlive() and isinstance(thread, StoppableThread):
|
if thread.isAlive() and isinstance(thread, StoppableThread):
|
||||||
|
logger.error('!!!! thread !!! -{}'.format(
|
||||||
|
thread))
|
||||||
thread.stopThread()
|
thread.stopThread()
|
||||||
|
|
||||||
UISignalQueue.put((
|
UISignalQueue.put((
|
||||||
'updateStatusBar',
|
'updateStatusBar',
|
||||||
'Saving the knownNodes list of peers to disk...'))
|
'Saving the knownNodes list of peers to disk...'))
|
||||||
logger.info('Saving knownNodes list of peers to disk')
|
logger.error('Saving knownNodes list of peers to disk')
|
||||||
saveKnownNodes()
|
saveKnownNodes()
|
||||||
logger.info('Done saving knownNodes list of peers to disk')
|
logger.error('Done saving knownNodes list of peers to disk')
|
||||||
UISignalQueue.put((
|
UISignalQueue.put((
|
||||||
'updateStatusBar',
|
'updateStatusBar',
|
||||||
'Done saving the knownNodes list of peers to disk.'))
|
'Done saving the knownNodes list of peers to disk.'))
|
||||||
logger.info('Flushing inventory in memory out to disk...')
|
logger.error('Flushing inventory in memory out to disk...')
|
||||||
UISignalQueue.put((
|
UISignalQueue.put((
|
||||||
'updateStatusBar',
|
'updateStatusBar',
|
||||||
'Flushing inventory in memory out to disk.'
|
'Flushing inventory in memory out to disk.'
|
||||||
|
@ -65,19 +67,36 @@ def doCleanShutdown():
|
||||||
time.sleep(.25)
|
time.sleep(.25)
|
||||||
|
|
||||||
for thread in threading.enumerate():
|
for thread in threading.enumerate():
|
||||||
|
if thread.name == 'singleAPI':
|
||||||
|
try:
|
||||||
|
logger.error('inside the shutdown try')
|
||||||
|
logger.error(
|
||||||
|
'thread flag -{}'.format(
|
||||||
|
thread.stop._flag))
|
||||||
|
thread.stop.set()
|
||||||
|
thread.stop.clear()
|
||||||
|
logger.error(
|
||||||
|
'After set clear thread flag -{}'.format(
|
||||||
|
thread.stop._flag))
|
||||||
|
# thread.stop.set()
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(
|
||||||
|
'======inside the shutdown except======='
|
||||||
|
)
|
||||||
|
logger.error(str(e))
|
||||||
if (
|
if (
|
||||||
thread is not threading.currentThread()
|
thread is not threading.currentThread()
|
||||||
and isinstance(thread, StoppableThread)
|
and isinstance(thread, StoppableThread)
|
||||||
and thread.name != 'SQL'
|
and thread.name != 'SQL'
|
||||||
):
|
):
|
||||||
logger.debug("Waiting for thread %s", thread.name)
|
logger.error("Waiting for thread %s", thread.name)
|
||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
# This one last useless query will guarantee that the previous flush
|
# This one last useless query will guarantee that the previous flush
|
||||||
# committed and that the
|
# committed and that the
|
||||||
# objectProcessorThread committed before we close the program.
|
# objectProcessorThread committed before we close the program.
|
||||||
sqlQuery('SELECT address FROM subscriptions')
|
sqlQuery('SELECT address FROM subscriptions')
|
||||||
logger.info('Finished flushing inventory.')
|
logger.error('Finished flushing inventory.')
|
||||||
sqlStoredProcedure('exit')
|
sqlStoredProcedure('exit')
|
||||||
|
|
||||||
# flush queues
|
# flush queues
|
||||||
|
@ -93,10 +112,10 @@ def doCleanShutdown():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if shared.thisapp.daemon or not state.enableGUI: # ..fixme:: redundant?
|
if shared.thisapp.daemon or not state.enableGUI: # ..fixme:: redundant?
|
||||||
logger.info('Clean shutdown complete.')
|
logger.error('Clean shutdown complete.')
|
||||||
shared.thisapp.cleanup()
|
shared.thisapp.cleanup()
|
||||||
os._exit(0) # pylint: disable=protected-access
|
os._exit(0) # pylint: disable=protected-access
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.info('Core shutdown complete.')
|
logger.error('Core shutdown complete.')
|
||||||
for thread in threading.enumerate():
|
for thread in threading.enumerate():
|
||||||
logger.debug('Thread %s still running', thread.name)
|
logger.error('Thread %s still running', thread.name)
|
||||||
|
|
Reference in New Issue
Block a user