Hi Mike, The job is running at an interval of 5min and the job in itself is very small. It finishes its work in less than a minute. It is a single thread job forked from the apsheduler process. In terms of memory-- since the job is very short running I don't think there is the scenario of memory running out. About parameters, as you can see from the code snippet all the parameters are fixed and hardcoded except the date.
On Tue, Jan 2, 2018 at 7:51 PM, Mike Bayer <mike...@zzzcomputing.com> wrote: > On Tue, Jan 2, 2018 at 2:21 AM, srishty patel <srishtypate...@gmail.com> > wrote: > > Code-snippet > > > > subq = db.session.query(Subscription.user_id) \ > > .filter(((Subscription.subscription_status == "EXPIRED") > > & (Subscription.end_date < expiration_limit)) | > > ((Subscription.subscription_status == "EXPIRED") > > & (Subscription.payment_service == 'O365')) > > ) > > > > query = db.session.query(SecUser, Subscription) \ > > .filter((Subscription.user_id.in_(subq)) > > & (Subscription.subscription_ > status.in_(["ACTIVE", > > "EXPIRED", "CANCELLED"])) > > & (Subscription.user_id == SecUser.parse_id) > > & (SecUser.is_premium == 1) > > & (SecUser.subscription_type.in_([0,1,5]))) \ > > .order_by(Subscription.user_id) > > > > Error : > > .... WHERE subscription.subscription_status = ? AND > subscription.end_date < > > ? OR subscription.subscription_status = ? AND > subscription.payment_service = > > ?) AND subscription.subscription_status IN (?, ?, ?) AND > > subscription.user_id = sec_user.parse_id AND sec_user.is_premium = ? AND > > sec_user.subscription_type IN (?, ?, ?) ORDER BY subscription.user_id'] > > [parameters: [immutabledict({})]] > > > > This issue is coming for a query in a cron job. The query runs smoothly > for > > an hour and suddenly its break with this error. After the first crash, > this > > crash is continuing and I keep seeing this immutable error. > > you say this is a "cron job" but how long is the process running, is > this a very long running process? does it use threads or eventlets, > and how is the memory use if it is long running, is the machine > running out of memory? It's not really possible for the params to go > blank like that unless you have some kind of execution events running, > any @event.listen or subclassing of internals going on ? I don't > recall any bug of this nature however the early 1.0.x series had a lot > of regressions, you can safely upgrade to 1.0.19 and I would recommend > doing so. > > > > > > Sqlalchemy version- 1.0.6 > > > > Database - SQL Server > > > > -- > > SQLAlchemy - > > The Python SQL Toolkit and Object Relational Mapper > > > > http://www.sqlalchemy.org/ > > > > To post example code, please provide an MCVE: Minimal, Complete, and > > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > > description. > > --- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to sqlalchemy+unsubscr...@googlegroups.com. > > To post to this group, send email to sqlalchemy@googlegroups.com. > > Visit this group at https://groups.google.com/group/sqlalchemy. > > For more options, visit https://groups.google.com/d/optout. > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to a topic in the > Google Groups "sqlalchemy" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/sqlalchemy/U5Bb1CrqVpw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.