Solved the addressGeneratorQueue get issue in the class_addressGeneratorQueue file

This commit is contained in:
jai.s 2020-09-15 20:20:56 +05:30
parent 7609a3ce40
commit afb3a22f99
No known key found for this signature in database
GPG Key ID: 360CFA25EFC67D12
4 changed files with 40 additions and 16 deletions

View File

@ -39,7 +39,7 @@ try:
varintDecodeError
)
from bmconfigparser import BMConfigParser
from debug import logger
from debug import logg
from helper_ackPayload import genAckPayload
from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery, sqlStoredProcedure
from inventory import Inventory
@ -638,7 +638,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
try:
queues.addressGeneratorQueue.put((
'createChan', addressVersionNumber, streamNumber, label,
passphrase, True
passphrase.decode(), True
))
logger.info(
'@@@@@@@@ before printing the queueReturn @@@@@@@@@')

View File

@ -75,10 +75,15 @@ class addressGenerator(StoppableThread):
while state.shutdown == 0:
logger.error(
'qqqqqqqqq1111111111111111111111111111111')
with self.lock:
try:
queueValue = queues.addressGeneratorQueue.get()
logger.error(
'qqqqqqqqq2222222222222222222222222222222')
logger.error('SuccessFully Loaded')
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
# logger.error('$$$$$$$$$$$$ queueValue @@@@@@@@@@@-{}'.format(queueValue))
payloadLengthExtraBytes = 0

View File

@ -51,7 +51,7 @@ class addressGeneratorQueueClass(Queue.Queue):
self.debug_file.write('Current-thread-{} \n'.format(
threading.current_thread().name))
self.debug_file.write('Traceback-{} \n'.format(
str(traceback.print_exc())))
str(traceback.format_stack())))
self.debug_file.write('Printig the put item-{}'.format(
item))
Queue.Queue.put(self, item, block, timeout)
@ -63,7 +63,7 @@ class addressGeneratorQueueClass(Queue.Queue):
self.debug_file.write('Current-thread-{} \n '.format(
threading.current_thread().name))
self.debug_file.write('Traceback-{} \n'.format(
str(traceback.print_exc())))
str(traceback.format_stack())))
item = Queue.Queue.get(self, block, timeout)
self.debug_file.write('Printig the get item-{}'.format(
str(item)))

View File

@ -35,18 +35,20 @@ def doCleanShutdown():
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
for thread in threading.enumerate():
if thread.isAlive() and isinstance(thread, StoppableThread):
logger.error('!!!! thread !!! -{}'.format(
thread))
thread.stopThread()
UISignalQueue.put((
'updateStatusBar',
'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()
logger.info('Done saving knownNodes list of peers to disk')
logger.error('Done saving knownNodes list of peers to disk')
UISignalQueue.put((
'updateStatusBar',
'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((
'updateStatusBar',
'Flushing inventory in memory out to disk.'
@ -65,19 +67,36 @@ def doCleanShutdown():
time.sleep(.25)
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 (
thread is not threading.currentThread()
and isinstance(thread, StoppableThread)
and thread.name != 'SQL'
):
logger.debug("Waiting for thread %s", thread.name)
logger.error("Waiting for thread %s", thread.name)
thread.join()
# This one last useless query will guarantee that the previous flush
# committed and that the
# objectProcessorThread committed before we close the program.
sqlQuery('SELECT address FROM subscriptions')
logger.info('Finished flushing inventory.')
logger.error('Finished flushing inventory.')
sqlStoredProcedure('exit')
# flush queues
@ -93,10 +112,10 @@ def doCleanShutdown():
try:
if shared.thisapp.daemon or not state.enableGUI: # ..fixme:: redundant?
logger.info('Clean shutdown complete.')
logger.error('Clean shutdown complete.')
shared.thisapp.cleanup()
os._exit(0) # pylint: disable=protected-access
except AttributeError:
logger.info('Core shutdown complete.')
logger.error('Core shutdown complete.')
for thread in threading.enumerate():
logger.debug('Thread %s still running', thread.name)
logger.error('Thread %s still running', thread.name)