rda-python-dsquasar 3.0.14__tar.gz → 3.0.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {rda_python_dsquasar-3.0.14/src/rda_python_dsquasar.egg-info → rda_python_dsquasar-3.0.16}/PKG-INFO +1 -1
  2. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/pyproject.toml +1 -1
  3. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/dsquasar.py +31 -9
  4. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16/src/rda_python_dsquasar.egg-info}/PKG-INFO +1 -1
  5. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/LICENSE +0 -0
  6. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/MANIFEST.in +0 -0
  7. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/README.md +0 -0
  8. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/setup.cfg +0 -0
  9. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/__init__.py +0 -0
  10. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/ds_quasar.py +0 -0
  11. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/dsquasar.usg +0 -0
  12. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/dstacc.py +0 -0
  13. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/taccrec.py +0 -0
  14. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar/tacctar.py +0 -0
  15. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar.egg-info/SOURCES.txt +0 -0
  16. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar.egg-info/dependency_links.txt +0 -0
  17. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar.egg-info/entry_points.txt +0 -0
  18. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar.egg-info/requires.txt +0 -0
  19. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/src/rda_python_dsquasar.egg-info/top_level.txt +0 -0
  20. {rda_python_dsquasar-3.0.14 → rda_python_dsquasar-3.0.16}/test/test_dsquasar.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsquasar
3
- Version: 3.0.14
3
+ Version: 3.0.16
4
4
  Summary: RDA Python package to backup and recover RDA data archives to and from GLOBUS Quasar backup server
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsquasar
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_dsquasar"
7
- version = "3.0.14"
7
+ version = "3.0.16"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -611,7 +611,7 @@ class DsQuasar(PgCMD, PgSplit):
611
611
  qinfo['dslocks'].remove(dsid)
612
612
  qinfo['dsids'] = []
613
613
  if self.PGBACK['mproc'] > 1:
614
- self.check_child(None, 0, self.LOGWRN, 1) # wait all child processes done
614
+ self.wait_all_children() # wait all child processes done
615
615
  self.confirm_quasar_counts(qinfo, qinfo['abids'], "status = 'T'") # recount confirmed backups from RDADB
616
616
  if qinfo['dslocks']:
617
617
  for dsid in qinfo['dslocks']:
@@ -728,7 +728,7 @@ class DsQuasar(PgCMD, PgSplit):
728
728
  self.unlock_backup_datasets(qinfo, dslocks)
729
729
  if self.PGBACK['dolock']: self.unlock_backup_datasets(qinfo, [dsid])
730
730
  if self.PGBACK['mproc'] > 1:
731
- self.check_child(None, 0, self.LOGWRN, 1) # wait all child processes done
731
+ self.wait_all_children() # wait all child processes done
732
732
  self.confirm_quasar_counts(qinfo, qinfo['abids'], "status = 'T'") # recount confirmed backups from RDADB
733
733
  qcnt = qinfo['qcnt']
734
734
  if qcnt > 0:
@@ -769,7 +769,7 @@ class DsQuasar(PgCMD, PgSplit):
769
769
  self.transfer_quasar_tarfiles(qinfo)
770
770
  if qinfo['size'] > 0: self.transfer_quasar_tarfiles(qinfo)
771
771
  if self.PGBACK['mproc'] > 1:
772
- self.check_child(None, 0, self.LOGWRN, 1) # wait all child processes done
772
+ self.wait_all_children() # wait all child processes done
773
773
  self.confirm_quasar_counts(qinfo, list(bfiles), "status = 'A'") # recount confirmed backups from RDADB
774
774
  qcnt = qinfo['qcnt']
775
775
  if qcnt > 0:
@@ -867,15 +867,17 @@ class DsQuasar(PgCMD, PgSplit):
867
867
  self.pglog("Cannot clean the progress report of {}; it is emailed again".format(cnd), self.LOGWRN)
868
868
  return estat
869
869
 
870
- # guard the long PBS batch jobs (-A 2/3/4/6) against the walltime: once past MAXRUNTIME
870
+ # guard the long PBS batch jobs (-A 2/3/4/6/7) against the walltime: once past MAXRUNTIME
871
871
  # the run keeps going, but a progress report is parked in dscheck.einfo so that
872
872
  # something is reported even if PBS kills the job at the walltime. the final report
873
873
  # follows and drops the parked one if the run does finish in time. the live email
874
874
  # buffers are saved and put back, so the final report still carries everything logged
875
875
  # before the cutoff.
876
- # both queue depths are reported rather than the current phase's: -A 3 and -A 6 run the
877
- # build and the transfer phase in one run, and -A 3 tars each input file right after
878
- # creating it, so its status 'N' count stays near zero while that is the busy phase.
876
+ # both queue depths are reported rather than the current phase's, because -A 3 tars each
877
+ # input file right after creating it, so its status 'N' count stays near zero while that
878
+ # is the busy phase. they are worded as STATES ('left to build', 'tarred') and not as
879
+ # work this run will do: only -A 4 and -A 6 transfer, so calling the status 'T' count
880
+ # 'to transfer' in an -A 2 or -A 3 report claims work that run never performs.
879
881
  # a no-op for command-line runs, other actions, before the cutoff, or once a progress
880
882
  # report is cached.
881
883
  # called from the top of every per-item loop, not only where a tar is dispatched: a long
@@ -885,7 +887,7 @@ class DsQuasar(PgCMD, PgSplit):
885
887
  def check_batch_deadline(self):
886
888
  act = self.PGBACK['action']
887
889
  if self.PGBACK['einfo'] or not (self.PGBACK['doemail'] and self.PGLOG['DSCHECK']): return
888
- if self.PGLOG['CURBID'] < 1 or act not in (self.TARACT, self.CTACTS, self.BCKACT, self.TBACTS): return
890
+ if self.PGLOG['CURBID'] < 1 or act not in (self.TARACT, self.CTACTS, self.BCKACT, self.TBACTS, self.CBACTS): return
889
891
  elapsed = tm() - self.PGBACK['starttime']
890
892
  if elapsed < self.MAXRUNTIME: return
891
893
  tcnt = self.batch_tar_count('N')
@@ -894,7 +896,7 @@ class DsQuasar(PgCMD, PgSplit):
894
896
  amsg = self.ACTMSG[act]
895
897
  bmsg = self.BACKMSG[self.PGBACK['backflag']] if self.PGBACK['backflag'] else 'backup'
896
898
  dmsg = self.batch_done_count()
897
- rmsg = "{} {} tar file(s) left to build and {} to transfer".format(tcnt, bmsg, bcnt)
899
+ rmsg = "{} {} tar file(s) left to build and {} tarred".format(tcnt, bmsg, bcnt)
898
900
  msg = "{}: Still running after {} of the {} PBS walltime, {}, with {}".format(amsg, etime, self.seconds_to_string_time(self.WALLTIME), dmsg, rmsg)
899
901
  self.pglog(self.INDENT + msg, self.LOGACT)
900
902
  saved = {key : self.PGLOG[key] for key in ('EMLMSG', 'ERRMSG', 'ERRCNT', 'SUMMSG', 'PRGMSG')}
@@ -904,6 +906,20 @@ class DsQuasar(PgCMD, PgSplit):
904
906
  self.report_dscheck_email(title, 1)
905
907
  self.PGLOG.update(saved)
906
908
 
909
+ # wait for every child process to finish, checking the walltime deadline between polls.
910
+ # check_child(..., 1) does the waiting inside its own loop, so a phase that ends with the
911
+ # last tar children still running would sit there for the rest of the run without ever
912
+ # reaching a deadline check - the parent has no per-item loop left to guard. polling with
913
+ # dowait 0 and sleeping here keeps the same cadence and wait message as check_child does.
914
+ def wait_all_children(self):
915
+ if self.PGBACK['mproc'] < 2: return
916
+ i = 0
917
+ while True:
918
+ self.check_batch_deadline()
919
+ if self.check_child(None, 0, self.LOGWRN, 0) < 1: break
920
+ self.show_wait_message(i, "{}: wait child processes".format(self.PGSIG['DSTR']), self.LOGWRN, 1)
921
+ i += 1
922
+
907
923
  # recompute the confirmed backup counts from RDADB after all child processes
908
924
  # finished, so a multi-process summary reflects succeeded (not just started) work
909
925
  def confirm_quasar_counts(self, qinfo, bids, dcnd):
@@ -1387,6 +1403,10 @@ class DsQuasar(PgCMD, PgSplit):
1387
1403
  dcnt = len(mrecs['dsid']) if mrecs else 0
1388
1404
  pgrecs = [self.onerecord(mrecs, i) for i in range(dcnt)]
1389
1405
  for pgrec in pgrecs:
1406
+ # a gather is not free: it queries every dataset, and each one another worker holds
1407
+ # costs an rdaps call to check that worker's pid. a run under dscheck does two of
1408
+ # them before any work, and -A 3 does a third one before tarring
1409
+ self.check_batch_deadline()
1390
1410
  dsid = pgrec['dsid']
1391
1411
  if unlock and pgrec['pid'] and self.lock_dataset(dsid, 0, self.LOGACT) < 1: continue
1392
1412
  fcnt += self.get_dataset_files(dsid, dsfiles, pgrec['backflag'], logact, sizes)
@@ -1411,6 +1431,7 @@ class DsQuasar(PgCMD, PgSplit):
1411
1431
  pgrecs = self.pgmget("bfile", flds, dcnd, self.LGWNEX)
1412
1432
  bcnt = len(pgrecs['bid']) if pgrecs else 0
1413
1433
  for i in range(bcnt):
1434
+ self.check_batch_deadline()
1414
1435
  cnt = self.get_backup_infile(dsfiles, self.onerecord(pgrecs, i))
1415
1436
  if cnt:
1416
1437
  icnt += 1
@@ -1436,6 +1457,7 @@ class DsQuasar(PgCMD, PgSplit):
1436
1457
  pgrecs = self.pgmget("bfile", flds, dcnd, self.LGWNEX)
1437
1458
  bcnt = len(pgrecs['bid']) if pgrecs else 0
1438
1459
  for i in range(bcnt):
1460
+ self.check_batch_deadline()
1439
1461
  cnt = self.get_backup_tarfile(dsfiles, self.onerecord(pgrecs, i))
1440
1462
  if cnt:
1441
1463
  tcnt += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsquasar
3
- Version: 3.0.14
3
+ Version: 3.0.16
4
4
  Summary: RDA Python package to backup and recover RDA data archives to and from GLOBUS Quasar backup server
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsquasar