<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="256266" data-post-id="256266">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sorentwo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sorentwo/120/37360_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sorentwo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Oban Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://hex.pm/packages/oban/2.13.0" rel="nofollow">Oban v2.13 is out</a>!</p>
<h2><a name="p-256266-cancel-directly-from-job-execution-1" class="anchor" href="#p-256266-cancel-directly-from-job-execution-1" aria-label="Heading link" rel="nofollow"></a>Cancel Directly from Job Execution</h2>
<p>Discard was initially intended to mean “a job exhausted all retries.” Later, it<br>
was added as a return type for <code>perform/1</code>, and it came to mean either “stop<br>
retrying” or “exhausted retries” ambiguously, with no clear way to<br>
differentiate. Even later, we introduced cancel with a <code>cancelled</code> state as a<br>
way to stop jobs at runtime.</p>
<p>To repair this dichotomy, we’re introducing a new <code>{:cancel, reason}</code> return<br>
type that transitions jobs to the <code>cancelled</code> state:</p>
<pre data-code-wrap="diff"><code class="lang-diff">case do_some_work(job) do
  {:ok, _result} = ok -&gt;
    ok

  {:error, :invalid} -&gt;
-   {:discard, :invalid}
+   {:cancel, :invalid}

  {:error, _reason} = error -&gt;
    error
end
</code></pre>
<p>With this change we’re also deprecating the use of discard from <code>perform/1</code><br>
entirely! The meaning of each action/state is now:</p>
<ul>
<li>
<p><code>cancel</code>—this job was purposefully stopped from retrying, either from a return<br>
value or the cancel command triggered by a <em>human</em></p>
</li>
<li>
<p><code>discard</code>—this job has exhausted all retries and transitioned by the <em>system</em></p>
</li>
</ul>
<p>You’re encouraged to replace usage of <code>:discard</code> with <code>:cancel</code> throughout your<br>
application’s workers, but <code>:discard</code> is only soft-deprecated and undocumented<br>
now.</p>
<h2><a name="p-256266-public-engine-behaviour-2" class="anchor" href="#p-256266-public-engine-behaviour-2" aria-label="Heading link" rel="nofollow"></a>Public Engine Behaviour</h2>
<p>Engines are responsible for all non-plugin database interaction, from inserting<br>
through executing jobs. They’re also the intermediate layer that makes Pro’s<br>
SmartEngine possible.</p>
<p>Along with documenting the Engine this also flattens its name for parity with<br>
other “extension” modules. For the sake of consistency with notifiers and peers,<br>
the Basic and Inline engines are now <code>Oban.Engines.Basic</code> and<br>
<code>Oban.Engines.Inline</code>, respectively.</p>
<h2><a name="p-256266-v2130-2022-07-22-3" class="anchor" href="#p-256266-v2130-2022-07-22-3" aria-label="Heading link" rel="nofollow"></a>v2.13.0 — 2022-07-22</h2>
<h2><a name="p-256266-enhancements-4" class="anchor" href="#p-256266-enhancements-4" aria-label="Heading link" rel="nofollow"></a>Enhancements</h2>
<ul>
<li>
<p>[Telemetry] Add <code>encode</code> option to make JSON encoding for <code>attach_default_logger/1</code>.</p>
<p>Now it’s possible to use the default logger in applications that prefer<br>
structured logging or use a standard JSON log formatter.</p>
</li>
<li>
<p>[Oban] Accept a <code>DateTime</code> for the <code>:with_scheduled</code> option when draining.</p>
<p>When a <code>DateTime</code> is provided, drains all jobs scheduled up to, and<br>
including, that point in time.</p>
</li>
<li>
<p>[Oban] Accept extra options for <code>insert/2,4</code> and <code>insert_all/2,4</code>.</p>
<p>These are typically the Ecto’s standard “Shared Options” such as <code>log</code> and<br>
<code>timeout</code>. Other engines, such as Pro’s <code>SmartEngine</code> may support additional<br>
options.</p>
</li>
<li>
<p>[Repo] Add <code>aggregate/4</code> wrapper to facilitate aggregates from plugins or<br>
other extensions that use <code>Oban.Repo</code>.</p>
</li>
</ul>
<h2><a name="p-256266-bug-fixes-5" class="anchor" href="#p-256266-bug-fixes-5" aria-label="Heading link" rel="nofollow"></a>Bug Fixes</h2>
<ul>
<li>
<p>[Oban] Prevent empty maps from matching non-empty maps during uniqueness checks.</p>
</li>
<li>
<p>[Oban] Handle discarded and exhausted states for inline testing mode.</p>
<p>Previously, returning a <code>:discard</code> tuple or exhausting attempts would cause an<br>
error.</p>
</li>
<li>
<p>[Peer] Default <code>leader?</code> check to false on peer timeout.</p>
<p>Timeouts should be rare, as they’re symptoms of application/database overload.<br>
If leadership can’t be established it’s safe to assume an instance isn’t<br>
leader and log a warning.</p>
</li>
<li>
<p>[Peer] Use node-specific lock requester id for Global peers.</p>
<p>Occasionally a peer module may hang while establishing leadership. In this<br>
case the peer isn’t yet a leader, and we can fallback to <code>false</code>.</p>
</li>
<li>
<p>[Config] Validate options only after applying normalizations.</p>
</li>
<li>
<p>[Migrations] Allow any viable <code>prefix</code> in migrations.</p>
</li>
<li>
<p>[Reindexer] Drop invalid Oban indexes before reindexing again.</p>
<p>Table contention that occurs during concurrent reindexing may leave indexes in<br>
an invalid, and unusable state. Those indexes aren’t used by Postgres and they<br>
take up disk space. Now the Reindexer will drop any invalid indexes before<br>
attempting to reindex.</p>
</li>
<li>
<p>[Reindexer] Only rebuild <code>args</code> and <code>meta</code> GIN indexes concurrently.</p>
<p>The new <code>indexes</code> option can be used to override the reindexed indexes rather<br>
than the defaults.</p>
<p>The other two standard indexes (primary key and compound fields) are BTREE<br>
based and not as subject to bloat.</p>
</li>
<li>
<p>[Testing] Fix testing mode for <code>perform_job</code> and alt engines, e.g. Inline</p>
<p>A couple of changes enabled this compound fix:</p>
<ol>
<li>Removing the engine override within config and exposing a centralized<br>
engine lookup instead.</li>
<li>Controlling post-execution db interaction with a new <code>ack</code> option for<br>
the Executor module.</li>
</ol>
</li>
</ul>
<h1><a name="p-256266-deprecations-6" class="anchor" href="#p-256266-deprecations-6" aria-label="Heading link" rel="nofollow"></a>Deprecations</h1>
<ul>
<li>[Oban] Soft replace discard with cancel return value</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="256266" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/253">Post #252</a>
	                </div>
	            </div>
              <div id="likers-container-256266" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="256266"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #252"></div>
  </section>
</div>
    <div class="postbit" id="258522" data-post-id="258522">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hello Oban people,</p>
<p>Recently I discovered “duplicate” Oban jobs being created. Some jobs had 19 copies, all with the exact same details. This meant the same job was handled in 19 processes at the exact same time <img src="https://forum.elixirforum.com/images/emoji/apple/laughing.png?v=15" title=":laughing:" class="emoji" alt=":laughing:" loading="lazy" width="20" height="20"></p>
<p>It was happening when a database transaction updating an Oban job crashed. For some reason this left an extra copy of the job in the table every time.</p>
<p>Today I am going to write some migrations with uniqueness constraints so this cannot happen again.</p>
<p>Something like:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">create unique_index(:oban_jobs, [:worker, :args], name: :oban_jobs_unique_worker_args_index)
</code></pre>
<p>The docs told me I would not need unique constraints for the oban jobs table:</p>
<blockquote>
<p>Unique jobs are guaranteed through transactional locks and database queries: they <em>do not</em> rely on unique constraints in the database. This makes uniqueness entirely configurable by application code, without the need for database migrations.</p>
</blockquote>
<p>but reality was different. I saw duplicate jobs being created because a Sage transaction crashed. The transaction crashed because of a bug in an Appsignal lib.</p>
<p>In the future, I will be advising anyone I work with to use database constraints on their oban jobs table. The “unique jobs” guarantee is not really a guarantee. It’s a good effort, but it doesn’t have the watertight safety of a database constraint.</p>
<p>Has anyone else experienced this?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258522" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/254">Post #253</a>
	                </div>
	            </div>
              <div id="likers-container-258522" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258522"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #253"></div>
  </section>
</div>
    <div class="postbit" id="258524" data-post-id="258524">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="al2o3cr" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/al2o3cr/120/3457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  al2o3cr
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="slouchpie" data-post="254" data-topic="22449">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/48/34819_2.png" class="avatar"> slouchpie:</div>
<blockquote>
<p>It was happening when a database transaction updating an Oban job crashed. For some reason this left an extra copy of the job in the table every time.</p>
</blockquote>
</aside>
<p>How is a crashed transaction writing results to the database? That seems like a bigger problem than the specifics of unique indexes.</p>
<p>I’ve seen similar behavior <a href="https://github.com/sorentwo/oban/issues/442" rel="nofollow">when using dynamic repos</a> - in that case, the job was written to the database on a different Connection, so the job appeared in the DB despite the main transaction rolling back.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258524" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/255">Post #254</a>
	                </div>
	            </div>
              <div id="likers-container-258524" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258524"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #254"></div>
  </section>
</div>
    <div class="postbit" id="258525" data-post-id="258525">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I agree. To be honest, I don’t know exactly where in the process it crashed. I only know the process was crashing at the same time as the duplicate oban job was inserted. The setup was simple too - single node server, single repo.</p>
<p>I wish I could provide better info on the circumstances but it has me stumped. All I know for certain is I had many duplicate jobs and each one was inserted at the same time that the Appsignal lib caused runtime error. The jobs are only ever inserted in transactions, so I have to assume the transaction crashed in some catastrophic way.</p>
<p>We have many tests for the normal “unique” approach of Oban jobs and we have been unable to recreated what we saw happen.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258525" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/256">Post #255</a>
	                </div>
	            </div>
              <div id="likers-container-258525" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258525"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #255"></div>
  </section>
</div>
    <div class="postbit" id="258526" data-post-id="258526">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m not looking forward to fielding the comments I get off this one, but I feel like it’s my duty to give an honest account of what happened, even though I cannot provide satisfactory information about the cause of the problem.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258526" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/257">Post #256</a>
	                </div>
	            </div>
              <div id="likers-container-258526" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258526"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #256"></div>
  </section>
</div>
    <div class="postbit" id="258528" data-post-id="258528">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sorentwo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sorentwo/120/37360_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sorentwo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Oban Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Inserting jobs through <code>Oban.insert</code> or <code>Oban.insert_all</code> without unique options is exactly equivalent to <code>Repo.insert</code> or <code>Repo.insert_all</code>. With unique options, it’s equivalent to <code>Repo.one</code> followed by <code>Repo.insert</code> with an upsert. The only way duplicate jobs, let alone 19 of them, were inserted simultaneously would be from a loop in your application (which is exactly what it sounds like happened).</p>
<p>You don’t <em>need</em> a unique index on worker and args, but you’re welcome to add one—it’s your database! The primary downside is a lack of flexibility when mixing unique and non-unique jobs.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258528" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/258">Post #257</a>
	                </div>
	            </div>
              <div id="likers-container-258528" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258528"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #257"></div>
  </section>
</div>
    <div class="postbit" id="258534" data-post-id="258534">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The jobs were not inserted in a loop.<br>
Some of the <code>inserted_at</code> values were days apart.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258534" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/259">Post #258</a>
	                </div>
	            </div>
              <div id="likers-container-258534" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258534"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #258"></div>
  </section>
</div>
    <div class="postbit" id="258536" data-post-id="258536">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sorentwo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sorentwo/120/37360_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sorentwo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Oban Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh, I misunderstood then. That seems even less peculiar! Were you using <code>unique</code> options? What is your pruning set to? Feel free to DM me or ask on Slack if you’d like to keep a debug conversation out of this thread.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258536" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/260">Post #259</a>
	                </div>
	            </div>
              <div id="likers-container-258536" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258536"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #259"></div>
  </section>
</div>
    <div class="postbit" id="258710" data-post-id="258710">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="slouchpie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/120/34819_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  slouchpie
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yes we are using <code>unique</code> options. They work perfectly most of the time. At other times, when we were seeing the Appsignal lib crashing, the <code>unique</code> options are not respected.</p>
<p>I very much appreciate the offer to DM/Slack but I am extremely busy and have higher priority things to tackle.</p>
<p>Oban is a fantastic library and we will keep using it.</p>
<p>I only wanted to record my honest experience. If anyone else encounters duplicate jobs violating the <code>unique</code> guarantee, I would urge them to create a database migration and sleep well at night.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258710" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/261">Post #260</a>
	                </div>
	            </div>
              <div id="likers-container-258710" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258710"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #260"></div>
  </section>
</div>
    <div class="postbit" id="258719" data-post-id="258719">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sorentwo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sorentwo/120/37360_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sorentwo
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Oban Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="slouchpie" data-post="261" data-topic="22449">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/48/34819_2.png" class="avatar"> slouchpie:</div>
<blockquote>
<p>I very much appreciate the offer to DM/Slack but I am extremely busy and have higher priority things to tackle.</p>
</blockquote>
</aside>
<p>Of course, we’re all busy. I’m not concerned about your issue from the Oban side, as I’m confident it is configuration or user error of some kind. Maybe you pruned jobs faster than the unique setting? Maybe you were using insert_all?</p>
<aside class="quote no-group" data-username="slouchpie" data-post="261" data-topic="22449">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/slouchpie/48/34819_2.png" class="avatar"> slouchpie:</div>
<blockquote>
<p>If anyone else encounters duplicate jobs violating the <code>unique</code> guarantee, I would urge them to create a database migration and sleep well at night.</p>
</blockquote>
</aside>
<p>I urge people <em>not</em> to create blanket unique constraints for worker/args as it’s inflexible and wasteful.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="258719" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/oban-reliable-and-observable-job-processing/22449/262">Post #261</a>
	                </div>
	            </div>
              <div id="likers-container-258719" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="258719"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #261"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/22449/load_more?page=27">Load more posts (51 remaining)</a>
</div></template></turbo-stream>