Repository navigation
·
1 commit
to development
since this release
- BL-2841 Retry for the
bx:httpcomponent and thehttp()BIF.withRetry( 3 )retries a request up to 3 times, andwithRetry( { times, delay, on, backoff, maxDelay, when, onRetry } )sets every option in one struct. Both mix withwithRetryDelay(),withRetryOn(),withRetryBackoff(),withRetryMaxDelay(),withRetryWhen()andonRetry(), and the last call wins per setting. The component has the matchingretry,retryDelay,retryOn,retryBackoff,retryMaxDelay,retryWhenandonRetryattributes. By default a request is retried on 408, 429, 502, 503 and 504 (timeouts are reported as 408 and connection failures as 502), waiting 1 second, withfixedorexponentialbackoff capped bymaxDelay(60 seconds). ARetry-Afterheader (seconds or an HTTP date) sets the wait, and if it is longer thanmaxDelayretrying stops and that response is returned.retryWhen( httpResult )can retry on other conditions.onError,onCompleteandthrowOnErrorapply to the final result only, the result has aretryCountkey, and a streaming request is not retried once a chunk callback has fired. Retry is off unless a retry count is set - BL-2820 Symbolic link support. New BIFs
fileCreateSymlink( link, target, overwrite ),fileIsSymlink( path )andfileReadSymlink( path, resolve ).fileInfo()andgetFileInfo()returnisLinkandlinkTarget, and thedirectoryList()query hasisLinkandlinkTargetcolumns.directoryList(),directoryCopy()anddirectoryDelete()(andbx:directory) gain afollowLinksargument that defaults to false. Behavior change:directoryDelete( path, true )no longer follows symbolic links, so it no longer empties the folders they point to (a link is removed as a link).directoryCopy()now copies links as links instead of copying their content or creating an empty folder - Scheduled tasks can now run once across a cluster of BoxLang servers instead of on every server. A task that opts in (
cluster: true, oronOneServer()) coordinates through a cache backed by a store every node can see, so a scheduled run normally happens on one node, work is spread across the nodes, and a node that goes down has its work picked up by the others. Coordination is best effort, not a hard guarantee: the cache offers no atomic create, so a contender paused between reading and writing its claim can overwrite a claim another node has already started. In that narrow window an occurrence can run twice. Duplicate detection reports it, but it cannot undo the side effects, so clustered jobs should be idempotent. New top-levelclusterblock inboxlang.json(enabled,nodeId,name,cacheName,heartbeatSeconds); whether this node is in a cluster is separate from whether tasks cluster, soscheduler.clusterTasks(default true) is the deployment default a task with noclusterflag inherits - set it to false on a clustered node to keep every task local unless it opts in - andscheduler.clusterModeselectseager(first writer wins) orbalanced(busier nodes wait longer, ranked by a rolling task-seconds window). Clustered tasks whose period is too short to complete a claim are rejected at startup with an actionable message rather than running late or twice. Each occurrence gets its own cache record, so one occurrence can never overwrite another's claim. A run ended by its own node's shutdown is recordedinterrupted; a run whose node disappeared is reportedabandonedby a peer. Every node keeps a full track record of every clustered run in itsscheduler.log, with a peer-observation thread reporting started and terminal states for all nodes. Breaking: a task marked as clustered now refuses to start when clustering is not enabled on that node, instead of silently running on every node;scheduler.cacheNameis deprecated but still honoured as an upgrade bridge (the old"default"value is ignored so upgrading does not switch clustering on) - BL-2809
systemExecute()gains three optional arguments for interactive CLI jobs.onLine( line, stream )is called on the calling thread as each output line arrives, before the process exits, withstreamset to"stdout"or"stderr", and output is still captured in the result.isCancelled()is polled while the process runs and, when it returns true, terminates the process tree and returns the output captured so far withcancelled = true(andterminated = true), distinct from a timeout.mergeErrors = truefolds stderr into stdout for a single live log. Streams are read character by character so a line that stalls before its newline is still captured. The result struct gains acancelledkey. Existing calls behave the same when the new arguments are omitted - BL-2808
Struct.putIfAbsentis now atomic and follows theMapcontract: it returns the existing value when the key is present (it used to returnnull) andnullonly when the key was absent. Change listeners fire only for the call that inserts.structInsert( struct, key, value, false )now claims the key atomically, so concurrent callers can no longer both succeed. AddsIStruct.tryPutIfAbsent, andStructMapWrapper.putIfAbsentnow returns the existing value too - BL-2717 Queries with more than 1,048,576 rows no longer lose rows or throw a NullPointerException when read.
ChunkedArrayList.trimToSize()released top-level chunks that still held live rows once a list had grown past its first layer of chunks, which chunked query storage reaches at 1,048,576 rows with the default chunk size - Cron scheduled tasks no longer silently skip a day when a tick runs late, e.g. when it is queued behind other tasks on a saturated scheduler executor. A tick now fires if a cron time was due since the previous check, runs late rather than never, and logs a warning (with a thread-count hint when the executor is saturated). Scheduled task constraints (weekdays, day of the week or month, first/last business day, time windows, start/end dates) are now judged against the time a tick was due, so a late tick is not skipped by crossing midnight. Scheduler executors are now sized from the
threadsof the executor named byscheduler.executorinboxlang.json(they were always 10), and the documentedthreadsproperty ofexecutorsentries is now honored. Also fixesexcludereplacing the cron gate onbx:scheduletasks that set bothcronTimeandexclude - BL-2840
boxlang formatfixes, found by formatting a real module (cborm) with its cfformat rules converted by--convertConfig. Code changes the formatter no longer makes: a variable as a script component attribute (transaction datasource=dsn) was written as the string"dsn"; a quoted named-argument key that is not an identifier ("strategy-outputDir" = x) lost its quotes and no longer compiled; a CF script component such assettingbecamecfsetting, which the next pass split into two statements; a comment beforeelsemoved after it and the next pass read an emptyelse; comments inside call arguments, closures passed to methods and chained calls were dropped or moved; a banner/* ***comment became a doc comment;a & "/#b#"was merged into one interpolated string. Stable output: a second pass no longer changes the result (blank lines before trailing comments, spaces after template comments, alignment). Settings honored:cfFormatCompatibilityin a.bxformat.jsonis now read; cfformat'selement_count/min_lengthrules for arguments, parameters, arrays and structs, measured as printed; alignment of consecutive assignments;comparison_style: preservekeepseq,AND,NOTand&&as written; compactfunction(){for closures; newclass.metadatamultiline setting for component header attributes (converted from cfformat'smetadata.multiline); parentheses padding incatch. Layout: closures passed to a call hug its parentheses; chains split by method calls, or when a call in the chain spans lines; expressions and quotes inside#...#are kept as written; block, doc and template comments keep their text and inner indentation; the same class body spacing for.cfcand.bx - BL-2840 In BoxLang script,
elsefollowed by a comment (} else // noteor} else /* note */ {) was read as a variable namedelse. A chained method name's source position now ends on its own line instead of the call's last line