<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[15762] twext/trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/15762">15762</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2016-07-13 10:06:17 -0700 (Wed, 13 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge better-next-job branch.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#twexttrunksetuppy">twext/trunk/setup.py</a></li>
<li><a href="#twexttrunktwextenterprisejobsjobitempy">twext/trunk/twext/enterprise/jobs/jobitem.py</a></li>
<li><a href="#twexttrunktwextenterprisejobsqueuepy">twext/trunk/twext/enterprise/jobs/queue.py</a></li>
<li><a href="#twexttrunktwextenterprisejobstesttest_jobspy">twext/trunk/twext/enterprise/jobs/test/test_jobs.py</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#twexttrunk">twext/trunk/</a></li>
<li><a href="#twexttrunktwext">twext/trunk/twext/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="twexttrunk"></a>
<div class="propset"><h4>Property changes: twext/trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/twext/branches/users/cdaboo/jobs:12742-12780
</span><span class="cx">/twext/branches/users/cdaboo/pod2pod-migration:14416-14520
</span><span class="cx">/twext/branches/users/sagen/recordtypes:13647-13658
</span><span class="cx">/twext/branches/users/sagen/recordtypes-2:13659
</span><span class="cx"> + /twext/branches/users/cdaboo/better-next-job:15726-15758
</span><span class="cx">/twext/branches/users/cdaboo/jobqueue-3:13444-13471
</span><span class="cx">/twext/branches/users/cdaboo/jobs:12742-12780
</span><span class="cx">/twext/branches/users/cdaboo/pod2pod-migration:14416-14520
</span><span class="cx">/twext/branches/users/sagen/recordtypes:13647-13658
</span><span class="cx">/twext/branches/users/sagen/recordtypes-2:13659
</span><a id="twexttrunksetuppy"></a>
<div class="modfile"><h4>Modified: twext/trunk/setup.py (15761 => 15762)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/setup.py        2016-07-13 02:23:31 UTC (rev 15761)
+++ twext/trunk/setup.py        2016-07-13 17:06:17 UTC (rev 15762)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> location = url.text[len(root.text):]
</span><span class="cx"> else:
</span><span class="cx"> location = url.text
</span><del>- project, branch = location.strip("/").split("/")
</del><ins>+ project, branch = location.strip("/").split("/", 1)
</ins><span class="cx">
</span><span class="cx"> return dict(
</span><span class="cx"> root=root.text,
</span><span class="lines">@@ -181,10 +181,10 @@
</span><span class="cx"> return "{}.b1.dev{}".format(base_version, info["revision"])
</span><span class="cx">
</span><span class="cx"> # This is some unknown branch or tag...
</span><del>- return "{}.a1.dev{}+{}".format(
</del><ins>+ return "{}a1.dev{}+{}".format(
</ins><span class="cx"> base_version,
</span><span class="cx"> info["revision"],
</span><del>- info["branch"].replace("/", "."),
</del><ins>+ info["branch"].replace("/", ".").replace("-", "."),
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="twexttrunktwext"></a>
<div class="propset"><h4>Property changes: twext/trunk/twext</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4>Modified: svn:mergeinfo</h4></div>
<span class="cx">/CalendarServer/branches/config-separation/twext:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351/twext:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore/twext:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store/twext:5594-5934
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile/twext:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2/twext:5936-5981
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev/twext:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev/twext:11846
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699/twext:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692/twext:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes/twext:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627/twext:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule/twext:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace/twext:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim/twext:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json/twext:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments/twext:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591/twext:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464/twext:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks/twext:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods/twext:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar/twext:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard/twext:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes/twext:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070/twext:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187/twext:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store/twext:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling/twext:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones/twext:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging/twext:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3/twext:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error/twext:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid/twext:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit/twext:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge/twext:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify/twext:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect/twext:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild/twext:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux/twext:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota/twext:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres/twext:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests/twext:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix/twext:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html/twext:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client/twext:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests/twext:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups/twext:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge/twext:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes/twext:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6/twext:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7/twext:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete/twext:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export/twext:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api/twext:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle/twext:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls/twext:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html/twext:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim/twext:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade/twext:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twext:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q/twext:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing/twext:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota/twext:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport/twext:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes/twext:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2/twext:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool/twext:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api/twext:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store/twext:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop/twext:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions/twext:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias/twext:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport/twext:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked/twext:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted/twext:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize/twext:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups/twext:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed/twext:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files/twext:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush/twext:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems/twext:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources/twext:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2/twext:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events/twext:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038/twext:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066/twext:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2/twext:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing/twext:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations/twext:5515-5593
</span><span class="cx">/twext/branches/users/cdaboo/jobqueue-3/twext:13444-13471
</span><span class="cx">/twext/branches/users/cdaboo/jobs/twext:12742-12780
</span><span class="cx">/twext/branches/users/cdaboo/pod2pod-migration/twext:14416-14520
</span><span class="cx">/twext/branches/users/sagen/recordtypes/twext:13647-13658
</span><span class="cx">/twext/branches/users/sagen/recordtypes-2/twext:13659
</span><span class="cx"> + /CalDAVTester/trunk/twext:11193-11198
</span><span class="cx">/CalendarServer/branches/config-separation/twext:4379-4443
</span><span class="cx">/CalendarServer/branches/egg-info-351/twext:4589-4625
</span><span class="cx">/CalendarServer/branches/generic-sqlstore/twext:6167-6191
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile-2/twext:5936-5981
</span><span class="cx">/CalendarServer/branches/new-store-no-caldavfile/twext:5911-5935
</span><span class="cx">/CalendarServer/branches/new-store/twext:5594-5934
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-4.3-dev/twext:10180-10190,10192
</span><span class="cx">/CalendarServer/branches/release/CalendarServer-5.1-dev/twext:11846
</span><span class="cx">/CalendarServer/branches/users/cdaboo/batchupload-6699/twext:6700-7198
</span><span class="cx">/CalendarServer/branches/users/cdaboo/cached-subscription-calendars-5692/twext:5693-5702
</span><span class="cx">/CalendarServer/branches/users/cdaboo/component-set-fixes/twext:8130-8346
</span><span class="cx">/CalendarServer/branches/users/cdaboo/directory-cache-on-demand-3627/twext:3628-3644
</span><span class="cx">/CalendarServer/branches/users/cdaboo/fix-no-ischedule/twext:11607-11871
</span><span class="cx">/CalendarServer/branches/users/cdaboo/implicituidrace/twext:8137-8141
</span><span class="cx">/CalendarServer/branches/users/cdaboo/ischedule-dkim/twext:9747-9979
</span><span class="cx">/CalendarServer/branches/users/cdaboo/json/twext:11622-11912
</span><span class="cx">/CalendarServer/branches/users/cdaboo/managed-attachments/twext:9985-10145
</span><span class="cx">/CalendarServer/branches/users/cdaboo/more-sharing-5591/twext:5592-5601
</span><span class="cx">/CalendarServer/branches/users/cdaboo/partition-4464/twext:4465-4957
</span><span class="cx">/CalendarServer/branches/users/cdaboo/performance-tweaks/twext:11824-11836
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pods/twext:7297-7377
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycalendar/twext:7085-7206
</span><span class="cx">/CalendarServer/branches/users/cdaboo/pycard/twext:7227-7237
</span><span class="cx">/CalendarServer/branches/users/cdaboo/queued-attendee-refreshes/twext:7740-8287
</span><span class="cx">/CalendarServer/branches/users/cdaboo/relative-config-paths-5070/twext:5071-5105
</span><span class="cx">/CalendarServer/branches/users/cdaboo/reverse-proxy-pods/twext:11875-11900
</span><span class="cx">/CalendarServer/branches/users/cdaboo/shared-calendars-5187/twext:5188-5440
</span><span class="cx">/CalendarServer/branches/users/cdaboo/sharing-in-the-store/twext:11935-12016
</span><span class="cx">/CalendarServer/branches/users/cdaboo/store-scheduling/twext:10876-11129
</span><span class="cx">/CalendarServer/branches/users/cdaboo/timezones/twext:7443-7699
</span><span class="cx">/CalendarServer/branches/users/cdaboo/txn-debugging/twext:8730-8743
</span><span class="cx">/CalendarServer/branches/users/gaya/sharedgroups-3/twext:11088-11204
</span><span class="cx">/CalendarServer/branches/users/glyph/always-abort-txn-on-error/twext:9958-9969
</span><span class="cx">/CalendarServer/branches/users/glyph/case-insensitive-uid/twext:8772-8805
</span><span class="cx">/CalendarServer/branches/users/glyph/conn-limit/twext:6574-6577
</span><span class="cx">/CalendarServer/branches/users/glyph/contacts-server-merge/twext:4971-5080
</span><span class="cx">/CalendarServer/branches/users/glyph/dalify/twext:6932-7023
</span><span class="cx">/CalendarServer/branches/users/glyph/db-reconnect/twext:6824-6876
</span><span class="cx">/CalendarServer/branches/users/glyph/deploybuild/twext:7563-7572
</span><span class="cx">/CalendarServer/branches/users/glyph/digest-auth-redux/twext:10624-10635
</span><span class="cx">/CalendarServer/branches/users/glyph/disable-quota/twext:7718-7727
</span><span class="cx">/CalendarServer/branches/users/glyph/dont-start-postgres/twext:6592-6614
</span><span class="cx">/CalendarServer/branches/users/glyph/enforce-max-requests/twext:11640-11643
</span><span class="cx">/CalendarServer/branches/users/glyph/hang-fix/twext:11465-11491
</span><span class="cx">/CalendarServer/branches/users/glyph/imip-and-admin-html/twext:7866-7984
</span><span class="cx">/CalendarServer/branches/users/glyph/ipv6-client/twext:9054-9105
</span><span class="cx">/CalendarServer/branches/users/glyph/launchd-wrapper-bis/twext:11413-11436
</span><span class="cx">/CalendarServer/branches/users/glyph/linux-tests/twext:6893-6900
</span><span class="cx">/CalendarServer/branches/users/glyph/log-cleanups/twext:11691-11731
</span><span class="cx">/CalendarServer/branches/users/glyph/migrate-merge/twext:8690-8713
</span><span class="cx">/CalendarServer/branches/users/glyph/misc-portability-fixes/twext:7365-7374
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-6/twext:6322-6368
</span><span class="cx">/CalendarServer/branches/users/glyph/more-deferreds-7/twext:6369-6445
</span><span class="cx">/CalendarServer/branches/users/glyph/multiget-delete/twext:8321-8330
</span><span class="cx">/CalendarServer/branches/users/glyph/new-export/twext:7444-7485
</span><span class="cx">/CalendarServer/branches/users/glyph/one-home-list-api/twext:10048-10073
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle-nulls/twext:7340-7351
</span><span class="cx">/CalendarServer/branches/users/glyph/oracle/twext:7106-7155
</span><span class="cx">/CalendarServer/branches/users/glyph/other-html/twext:8062-8091
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-sim/twext:8240-8251
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade/twext:8376-8400
</span><span class="cx">/CalendarServer/branches/users/glyph/parallel-upgrade_to_1/twext:8571-8583
</span><span class="cx">/CalendarServer/branches/users/glyph/q/twext:9560-9688
</span><span class="cx">/CalendarServer/branches/users/glyph/queue-locking-and-timing/twext:10204-10289
</span><span class="cx">/CalendarServer/branches/users/glyph/quota/twext:7604-7637
</span><span class="cx">/CalendarServer/branches/users/glyph/sendfdport/twext:5388-5424
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-fixes/twext:8436-8443
</span><span class="cx">/CalendarServer/branches/users/glyph/shared-pool-take2/twext:8155-8174
</span><span class="cx">/CalendarServer/branches/users/glyph/sharedpool/twext:6490-6550
</span><span class="cx">/CalendarServer/branches/users/glyph/sharing-api/twext:9192-9205
</span><span class="cx">/CalendarServer/branches/users/glyph/skip-lonely-vtimezones/twext:8524-8535
</span><span class="cx">/CalendarServer/branches/users/glyph/sql-store/twext:5929-6073
</span><span class="cx">/CalendarServer/branches/users/glyph/start-service-start-loop/twext:11060-11065
</span><span class="cx">/CalendarServer/branches/users/glyph/subtransactions/twext:7248-7258
</span><span class="cx">/CalendarServer/branches/users/glyph/table-alias/twext:8651-8664
</span><span class="cx">/CalendarServer/branches/users/glyph/uidexport/twext:7673-7676
</span><span class="cx">/CalendarServer/branches/users/glyph/unshare-when-access-revoked/twext:10562-10595
</span><span class="cx">/CalendarServer/branches/users/glyph/use-system-twisted/twext:5084-5149
</span><span class="cx">/CalendarServer/branches/users/glyph/uuid-normalize/twext:9268-9296
</span><span class="cx">/CalendarServer/branches/users/glyph/warning-cleanups/twext:11347-11357
</span><span class="cx">/CalendarServer/branches/users/glyph/whenNotProposed/twext:11881-11897
</span><span class="cx">/CalendarServer/branches/users/glyph/xattrs-from-files/twext:7757-7769
</span><span class="cx">/CalendarServer/branches/users/sagen/applepush/twext:8126-8184
</span><span class="cx">/CalendarServer/branches/users/sagen/inboxitems/twext:7380-7381
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources-2/twext:5052-5061
</span><span class="cx">/CalendarServer/branches/users/sagen/locations-resources/twext:5032-5051
</span><span class="cx">/CalendarServer/branches/users/sagen/purge_old_events/twext:6735-6746
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4038/twext:4040-4067
</span><span class="cx">/CalendarServer/branches/users/sagen/resource-delegates-4066/twext:4068-4075
</span><span class="cx">/CalendarServer/branches/users/sagen/resources-2/twext:5084-5093
</span><span class="cx">/CalendarServer/branches/users/sagen/testing/twext:10827-10851,10853-10855
</span><span class="cx">/CalendarServer/branches/users/wsanchez/transations/twext:5515-5593
</span><span class="cx">/twext/branches/users/cdaboo/better-next-job/twext:15726-15758
</span><span class="cx">/twext/branches/users/cdaboo/jobqueue-3/twext:13444-13471
</span><span class="cx">/twext/branches/users/cdaboo/jobs/twext:12742-12780
</span><span class="cx">/twext/branches/users/cdaboo/pod2pod-migration/twext:14416-14520
</span><span class="cx">/twext/branches/users/sagen/recordtypes-2/twext:13659
</span><span class="cx">/twext/branches/users/sagen/recordtypes/twext:13647-13658
</span><a id="twexttrunktwextenterprisejobsjobitempy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/enterprise/jobs/jobitem.py (15761 => 15762)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/enterprise/jobs/jobitem.py        2016-07-13 02:23:31 UTC (rev 15761)
+++ twext/trunk/twext/enterprise/jobs/jobitem.py        2016-07-13 17:06:17 UTC (rev 15762)
</span><span class="lines">@@ -60,13 +60,14 @@
</span><span class="cx">
</span><span class="cx"> JobTable.addColumn("JOB_ID", SQLType("integer", None), default=Sequence(inSchema, "JOB_SEQ"), notNull=True, primaryKey=True)
</span><span class="cx"> JobTable.addColumn("WORK_TYPE", SQLType("varchar", 255), notNull=True)
</span><del>- JobTable.addColumn("PRIORITY", SQLType("integer", 0), default=0)
- JobTable.addColumn("WEIGHT", SQLType("integer", 0), default=0)
</del><ins>+ JobTable.addColumn("PRIORITY", SQLType("integer", 0), default=0, notNull=True)
+ JobTable.addColumn("WEIGHT", SQLType("integer", 0), default=0, notNull=True)
</ins><span class="cx"> JobTable.addColumn("NOT_BEFORE", SQLType("timestamp", None), notNull=True)
</span><ins>+ JobTable.addColumn("IS_ASSIGNED", SQLType("integer", 0), default=0, notNull=True)
</ins><span class="cx"> JobTable.addColumn("ASSIGNED", SQLType("timestamp", None), default=None)
</span><span class="cx"> JobTable.addColumn("OVERDUE", SQLType("timestamp", None), default=None)
</span><del>- JobTable.addColumn("FAILED", SQLType("integer", 0), default=0)
- JobTable.addColumn("PAUSE", SQLType("integer", 0), default=0)
</del><ins>+ JobTable.addColumn("FAILED", SQLType("integer", 0), default=0, notNull=True)
+ JobTable.addColumn("PAUSE", SQLType("integer", 0), default=0, notNull=True)
</ins><span class="cx">
</span><span class="cx"> return inSchema
</span><span class="cx">
</span><span class="lines">@@ -168,14 +169,14 @@
</span><span class="cx"> @param overdue: number of seconds after assignment that the job will be considered overdue
</span><span class="cx"> @type overdue: L{int}
</span><span class="cx"> """
</span><del>- return self.update(assigned=when, overdue=when + timedelta(seconds=overdue))
</del><ins>+ return self.update(isAssigned=1, assigned=when, overdue=when + timedelta(seconds=overdue))
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def unassign(self):
</span><span class="cx"> """
</span><span class="cx"> Mark this job as unassigned by setting the assigned and overdue columns to L{None}.
</span><span class="cx"> """
</span><del>- return self.update(assigned=None, overdue=None)
</del><ins>+ return self.update(isAssigned=0, assigned=None, overdue=None)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> def bumpOverdue(self, bump):
</span><span class="lines">@@ -208,6 +209,7 @@
</span><span class="cx"> delay = self.lockRescheduleInterval if locked else self.failureRescheduleInterval
</span><span class="cx"> delay *= (self.failed + 1)
</span><span class="cx"> return self.update(
</span><ins>+ isAssigned=0,
</ins><span class="cx"> assigned=None,
</span><span class="cx"> overdue=None,
</span><span class="cx"> failed=self.failed + (0 if locked else 1),
</span><span class="lines">@@ -358,12 +360,16 @@
</span><span class="cx">
</span><span class="cx"> @classmethod
</span><span class="cx"> @inlineCallbacks
</span><del>- def nextjob(cls, txn, now, minPriority):
</del><ins>+ def nextjob(cls, txn, now, minPriority, rowLimit):
</ins><span class="cx"> """
</span><span class="cx"> Find the next available job based on priority, also return any that are overdue. This
</span><span class="cx"> method uses an SQL query to find the matching jobs, and sorts based on the NOT_BEFORE
</span><span class="cx"> value and priority.
</span><span class="cx">
</span><ins>+ The C{rowLimit} value is used to help with concurrency problems when the underlying DB does
+ not support a proper "LIMIT" term with the query (Oracle). It should be set to no more than
+ 1 plus the number of app-servers in use).
+
</ins><span class="cx"> @param txn: the transaction to use
</span><span class="cx"> @type txn: L{IAsyncTransaction}
</span><span class="cx"> @param now: current timestamp - needed for unit tests that might use their
</span><span class="lines">@@ -371,6 +377,8 @@
</span><span class="cx"> @type now: L{datetime.datetime}
</span><span class="cx"> @param minPriority: lowest priority level to query for
</span><span class="cx"> @type minPriority: L{int}
</span><ins>+ @param rowLimit: query at most this number of rows at a time
+ @type rowLimit: L{int}
</ins><span class="cx">
</span><span class="cx"> @return: the job record
</span><span class="cx"> @rtype: L{JobItem}
</span><span class="lines">@@ -387,12 +395,12 @@
</span><span class="cx"> # being fetched is locked and existing locked rows are skipped.
</span><span class="cx">
</span><span class="cx"> job = None
</span><del>- jobID = yield Call("next_job", now, minPriority, returnType=int).on(txn)
</del><ins>+ jobID = yield Call("next_job", now, minPriority, rowLimit, returnType=int).on(txn)
</ins><span class="cx"> if jobID:
</span><span class="cx"> job = yield cls.load(txn, jobID)
</span><span class="cx"> else:
</span><span class="cx"> # Only add the PRIORITY term if minimum is greater than zero
</span><del>- queryExpr = (cls.assigned == None).And(cls.pause == 0).And(cls.notBefore <= now)
</del><ins>+ queryExpr = (cls.isAssigned == 0).And(cls.pause == 0).And(cls.notBefore <= now)
</ins><span class="cx">
</span><span class="cx"> # PRIORITY can only be 0, 1, or 2. So we can convert an inequality into
</span><span class="cx"> # an equality test as follows:
</span><span class="lines">@@ -419,7 +427,7 @@
</span><span class="cx"> ascending=False,
</span><span class="cx"> forUpdate=True,
</span><span class="cx"> noWait=False,
</span><del>- limit=1,
</del><ins>+ limit=rowLimit,
</ins><span class="cx"> **extra_kwargs
</span><span class="cx"> )
</span><span class="cx"> job = jobs[0] if jobs else None
</span><span class="lines">@@ -429,14 +437,20 @@
</span><span class="cx">
</span><span class="cx"> @classmethod
</span><span class="cx"> @inlineCallbacks
</span><del>- def overduejob(cls, txn, now):
</del><ins>+ def overduejob(cls, txn, now, rowLimit):
</ins><span class="cx"> """
</span><span class="cx"> Find the next overdue job.
</span><span class="cx">
</span><ins>+ The C{rowLimit} value is used to help with concurrency problems when the underlying DB does
+ not support a proper "LIMIT" term with the query (Oracle). It should be set to no more than
+ 1 plus the number of app-servers in use).
+
</ins><span class="cx"> @param txn: the transaction to use
</span><span class="cx"> @type txn: L{IAsyncTransaction}
</span><span class="cx"> @param now: current timestamp
</span><span class="cx"> @type now: L{datetime.datetime}
</span><ins>+ @param rowLimit: query at most this number of rows at a time
+ @type rowLimit: L{int}
</ins><span class="cx">
</span><span class="cx"> @return: the job record
</span><span class="cx"> @rtype: L{JobItem}
</span><span class="lines">@@ -445,7 +459,7 @@
</span><span class="cx"> if txn.dbtype.dialect == ORACLE_DIALECT:
</span><span class="cx"> # See L{nextjob} for why Oracle is different
</span><span class="cx"> job = None
</span><del>- jobID = yield Call("overdue_job", now, returnType=int).on(txn)
</del><ins>+ jobID = yield Call("overdue_job", now, rowLimit, returnType=int).on(txn)
</ins><span class="cx"> if jobID:
</span><span class="cx"> job = yield cls.load(txn, jobID)
</span><span class="cx"> else:
</span><span class="lines">@@ -454,10 +468,10 @@
</span><span class="cx"> extra_kwargs["skipLocked"] = True
</span><span class="cx"> jobs = yield cls.query(
</span><span class="cx"> txn,
</span><del>- (cls.assigned != None).And(cls.overdue < now),
</del><ins>+ (cls.isAssigned == 1).And(cls.overdue < now),
</ins><span class="cx"> forUpdate=True,
</span><span class="cx"> noWait=False,
</span><del>- limit=1,
</del><ins>+ limit=rowLimit,
</ins><span class="cx"> **extra_kwargs
</span><span class="cx"> )
</span><span class="cx"> job = jobs[0] if jobs else None
</span></span></pre></div>
<a id="twexttrunktwextenterprisejobsqueuepy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/enterprise/jobs/queue.py (15761 => 15762)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/enterprise/jobs/queue.py        2016-07-13 02:23:31 UTC (rev 15761)
+++ twext/trunk/twext/enterprise/jobs/queue.py        2016-07-13 17:06:17 UTC (rev 15762)
</span><span class="lines">@@ -463,6 +463,12 @@
</span><span class="cx"> highPriorityLevel = 80 # Percentage load level above which only high priority jobs are processed
</span><span class="cx"> mediumPriorityLevel = 50 # Percentage load level above which high and medium priority jobs are processed
</span><span class="cx">
</span><ins>+ # Used to help with concurrency problems when the underlying DB does not
+ # support a proper "LIMIT" term with the query (Oracle). It should be set to
+ # no more than 1 plus the number of app-servers in use). For a single app
+ # server always use 1.
+ rowLimit = 1
+
</ins><span class="cx"> def __init__(self, reactor, transactionFactory, useWorkerPool=True, disableWorkProcessing=False):
</span><span class="cx"> """
</span><span class="cx"> Initialize a L{ControllerQueue}.
</span><span class="lines">@@ -577,7 +583,7 @@
</span><span class="cx"> txn = nextJob = None
</span><span class="cx"> try:
</span><span class="cx"> txn = self.transactionFactory(label="jobqueue.workCheck")
</span><del>- nextJob = yield JobItem.nextjob(txn, nowTime, minPriority)
</del><ins>+ nextJob = yield JobItem.nextjob(txn, nowTime, minPriority, self.rowLimit)
</ins><span class="cx"> if nextJob is None:
</span><span class="cx"> break
</span><span class="cx">
</span><span class="lines">@@ -706,7 +712,7 @@
</span><span class="cx"> txn = overdueJob = None
</span><span class="cx"> try:
</span><span class="cx"> txn = self.transactionFactory(label="jobqueue.overdueCheck")
</span><del>- overdueJob = yield JobItem.overduejob(txn, nowTime)
</del><ins>+ overdueJob = yield JobItem.overduejob(txn, nowTime, self.rowLimit)
</ins><span class="cx"> if overdueJob is None:
</span><span class="cx"> break
</span><span class="cx">
</span></span></pre></div>
<a id="twexttrunktwextenterprisejobstesttest_jobspy"></a>
<div class="modfile"><h4>Modified: twext/trunk/twext/enterprise/jobs/test/test_jobs.py (15761 => 15762)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/twext/enterprise/jobs/test/test_jobs.py        2016-07-13 02:23:31 UTC (rev 15761)
+++ twext/trunk/twext/enterprise/jobs/test/test_jobs.py        2016-07-13 17:06:17 UTC (rev 15762)
</span><span class="lines">@@ -193,13 +193,14 @@
</span><span class="cx"> create table JOB (
</span><span class="cx"> JOB_ID integer primary key default 1,
</span><span class="cx"> WORK_TYPE varchar(255) not null,
</span><del>- PRIORITY integer default 0,
- WEIGHT integer default 0,
</del><ins>+ PRIORITY integer default 0 not null,
+ WEIGHT integer default 0 not null,
</ins><span class="cx"> NOT_BEFORE timestamp not null,
</span><ins>+ IS_ASSIGNED integer default 0 not null,
</ins><span class="cx"> ASSIGNED timestamp default null,
</span><span class="cx"> OVERDUE timestamp default null,
</span><del>- FAILED integer default 0,
- PAUSE integer default 0
</del><ins>+ FAILED integer default 0 not null,
+ PAUSE integer default 0 not null
</ins><span class="cx"> );
</span><span class="cx"> """
</span><span class="cx"> )
</span><span class="lines">@@ -463,6 +464,7 @@
</span><span class="cx"> self.assertTrue(len(jobs) == 1)
</span><span class="cx"> self.assertTrue(jobs[0].workType == "DUMMY_WORK_ITEM")
</span><span class="cx"> self.assertTrue(jobs[0].assigned is None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx">
</span><span class="cx"> @transactionally(dbpool.connection)
</span><span class="cx"> def checkWork(txn):
</span><span class="lines">@@ -488,6 +490,7 @@
</span><span class="cx"> jobs = yield inTransaction(dbpool.connection, checkJob)
</span><span class="cx"> self.assertTrue(len(jobs) == 1)
</span><span class="cx"> self.assertTrue(jobs[0].assigned is None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def assignJob(txn):
</span><span class="lines">@@ -498,6 +501,7 @@
</span><span class="cx"> jobs = yield inTransaction(dbpool.connection, checkJob)
</span><span class="cx"> self.assertTrue(len(jobs) == 1)
</span><span class="cx"> self.assertTrue(jobs[0].assigned is not None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 1)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> @inlineCallbacks
</span><span class="lines">@@ -512,7 +516,7 @@
</span><span class="cx"> # Empty job queue
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def _next(txn, priority=WORK_PRIORITY_LOW):
</span><del>- job = yield JobItem.nextjob(txn, now, priority)
</del><ins>+ job = yield JobItem.nextjob(txn, now, priority, 1)
</ins><span class="cx"> if job is not None:
</span><span class="cx"> work = yield job.workItem()
</span><span class="cx"> else:
</span><span class="lines">@@ -1196,6 +1200,7 @@
</span><span class="cx"> jobs = yield check
</span><span class="cx"> self.assertTrue(len(jobs) == 1)
</span><span class="cx"> self.assertTrue(jobs[0].assigned is None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx"> self.assertTrue(jobs[0].failed == 1)
</span><span class="cx"> self.assertTrue(jobs[0].notBefore > datetime.datetime.utcnow())
</span><span class="cx">
</span><span class="lines">@@ -1230,6 +1235,7 @@
</span><span class="cx"> jobs = yield check
</span><span class="cx"> self.assertTrue(len(jobs) == 1)
</span><span class="cx"> self.assertTrue(jobs[0].assigned is None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx"> self.assertTrue(jobs[0].failed == 1)
</span><span class="cx"> self.assertTrue(jobs[0].notBefore > datetime.datetime.utcnow() + datetime.timedelta(seconds=90))
</span><span class="cx">
</span><span class="lines">@@ -1244,8 +1250,8 @@
</span><span class="cx">
</span><span class="cx"> oldNextJob = JobItem.nextjob
</span><span class="cx"> @inlineCallbacks
</span><del>- def _nextJob(cls, txn, now, minPriority):
- job = yield oldNextJob(txn, now, minPriority)
</del><ins>+ def _nextJob(cls, txn, now, minPriority, rowLimit):
+ job = yield oldNextJob(txn, now, minPriority, rowLimit)
</ins><span class="cx"> work = yield job.workItem()
</span><span class="cx"> if work.a == -2:
</span><span class="cx"> raise ValueError("oops")
</span><span class="lines">@@ -1277,9 +1283,11 @@
</span><span class="cx"> jobs = yield check
</span><span class="cx"> self.assertEqual(len(jobs), 2)
</span><span class="cx"> self.assertEqual(jobs[0].assigned, None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx"> self.assertEqual(jobs[0].failed, 0)
</span><span class="cx"> self.assertEqual(jobs[0].notBefore, fakeNow - datetime.timedelta(20 * 60))
</span><span class="cx"> self.assertEqual(jobs[1].assigned, None)
</span><ins>+ self.assertEqual(jobs[1].isAssigned, 0)
</ins><span class="cx"> self.assertEqual(jobs[1].failed, 0)
</span><span class="cx"> self.assertEqual(jobs[1].notBefore, fakeNow - datetime.timedelta(20 * 60, 5))
</span><span class="cx">
</span><span class="lines">@@ -1327,6 +1335,7 @@
</span><span class="cx"> jobs = yield check
</span><span class="cx"> self.assertEqual(len(jobs), 1)
</span><span class="cx"> self.assertEqual(jobs[0].assigned, None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx"> self.assertEqual(jobs[0].failed, 1)
</span><span class="cx"> self.assertGreater(jobs[0].notBefore, datetime.datetime.utcnow() + datetime.timedelta(seconds=30))
</span><span class="cx">
</span><span class="lines">@@ -1380,9 +1389,11 @@
</span><span class="cx"> jobs = yield check
</span><span class="cx"> self.assertEqual(len(jobs), 2)
</span><span class="cx"> self.assertEqual(jobs[0].assigned, None)
</span><ins>+ self.assertEqual(jobs[0].isAssigned, 0)
</ins><span class="cx"> self.assertEqual(jobs[0].failed, 0)
</span><span class="cx"> self.assertEqual(jobs[0].notBefore, fakeNow - datetime.timedelta(20 * 60))
</span><span class="cx"> self.assertEqual(jobs[1].assigned, None)
</span><ins>+ self.assertEqual(jobs[1].isAssigned, 0)
</ins><span class="cx"> self.assertEqual(jobs[1].failed, 0)
</span><span class="cx"> self.assertEqual(jobs[1].notBefore, fakeNow - datetime.timedelta(20 * 60, 5))
</span><span class="cx">
</span><span class="lines">@@ -1872,7 +1883,7 @@
</span><span class="cx"> @inlineCallbacks
</span><span class="cx"> def _testNone(txn):
</span><span class="cx"> nowTime = datetime.datetime.utcfromtimestamp(reactor.seconds() + 10)
</span><del>- job = yield JobItem.nextjob(txn, nowTime, WORK_PRIORITY_HIGH)
</del><ins>+ job = yield JobItem.nextjob(txn, nowTime, WORK_PRIORITY_HIGH, 1)
</ins><span class="cx"> self.assertTrue(job is None)
</span><span class="cx">
</span><span class="cx"> yield _testNone
</span></span></pre>
</div>
</div>
</body>
</html>